static __registerFileHeader(cfg, target) {
    const { name, fileHeader } = cfg;
    if (typeof name !== 'string')
      throw new Error("Can't register file header; options.name must be a string");
    if (typeof fileHeader !== 'function')
      throw new Error("Can't register file header; options.fileHeader must be a function");
    this.deleteExistingHook(target, 'fileHeaders', name);

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