How to use the @phensley/cldr-core.checksumIndices function in @phensley/cldr-core

To help you get started, we’ve selected a few @phensley/cldr-core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phensley / cldr-engine / packages / cldr-compiler / src / cli / compiler / pack.ts View on Github external
validateConfig(config);
  } else {
    config = DEFAULT_CONFIG;
  }

  const regions = new Set(argv.regions ? argv.regions.split(',') : []);

  const dest = argv.out;
  if (!fs.existsSync(dest)) {
    fs.mkdirSync(dest);
  }

  // Configure the schema accessor builder
  const builder = new CodeBuilder(config);
  const origin = builder.origin();
  const checksum = checksumIndices(pkg.version, origin.indices);

  const rbnf = new RBNFCollector();
  rbnf.load();

  let path: string;
  const hashes: { [x: string]: string } = {};
  const pkghash = createHash('sha256');
  langs.forEach(lang => {
    console.warn(`processing:  ${lang}`);

    // Get the list of languages that should live together in this bundle.
    let locales = localeMap[lang];

    if (regions.size > 0) {
      locales = locales.filter(l => l.id === lang || regions.has(l.tag.region()));
    }