constructor()

in lib/MaterialTools.ts [21:43]


  constructor(_options: MaterialToolsOptions | string) {

    if (!_options) {
      throw new Error('No options have been specified.');
    }

    let options = typeof _options === 'string' ? require(path.resolve(_options)) : _options;

    Utils.forEach(DefaultConfig.options, (value, key) => {
      if (typeof options[key] === 'undefined') {
        options[key] = value;
      }
    });

    if (options.destination) {
      options.destination = path.resolve(options.destination);
    } else {
      throw new Error('You have to specify a destination.');
    }

    // Initialize the MaterialBuilder with the validated options.
    super(options);
  }