function collect(source, options = {}) {
    const opts = {
      generateOuterTokenName: options.genOuterTokenName,
      plugins: [],
      presets: [],
      reactNativeMode: options.react_native_mode,
      transform: null,
      fbtCommonPath,
    };
    const fbtCollector = getFbtCollector(opts, {}, options.customCollector);
    const packager = options.packagerType ?? packagerTypes.NONE;
    const packagers = getPackagers(
      packager,
      path.join(__dirname, '../md5Texts'),
    );
    if (options.multipleFiles) {
      fs.hasOwnProperty = () => Object.hasOwnProperty; // For jest.spyOn
      jest.spyOn(fs, 'readFileSync').mockImplementation(path => source[path]);
      fbtCollector.collectFromFiles(Object.keys(source));
    } else {
      fbtCollector.collectFromOneFile(source);
    }
    const output = buildCollectFbtOutput(fbtCollector, packagers, {
      terse: options.terse,
      genFbtNodes: options.genFbtNodes,
    });
    // Mimic collectFbt output: strip undefined fields, and normalize objects
    return JSON.parse(JSON.stringify(output));
  }
(c) Meta Platforms, Inc. and affiliates. Confidential and proprietary.

@format
@oncall i18n_fbt_js