static __registerPreprocessor(cfg, target) {
    const { name, preprocessor } = cfg;
    const errorPrefix = 'Cannot register preprocessor;';
    if (typeof name !== 'string')
      throw new Error(`${errorPrefix} Preprocessor.name must be a string`);
    if (!(preprocessor instanceof Function)) {
      throw new Error(`${errorPrefix} Preprocessor.preprocessor must be a function`);
    }
    this.deleteExistingHook(target, 'preprocessors', name);

    // make sure to trigger the setter
    target.hooks = deepmerge(target.hooks, {
      preprocessors: {
        [name]: preprocessor,
      },
    });
    return target;
  }
@param {Preprocessor} cfg
@param {typeof Register | Register} target