How to use the @phensley/cldr-utils.binarySearch function in @phensley/cldr-utils

To help you get started, we’ve selected a few @phensley/cldr-utils 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 / timezone / src / index.ts View on Github external
fromUTC(utc: number): ZoneInfoRec {
    const i = binarySearch(this.untils, true, utc);
    const type = i === -1 ? 0 : this.types[i];
    return this.localtime[type];
  }
github phensley / cldr-engine / packages / cldr-core / src / internals / calendars / rules.ts View on Github external
get(bundle: Bundle, minutes: number): DayPeriodType | undefined {
    const raw = dayPeriodRules[bundle.languageRegion()] || dayPeriodRules[bundle.language()];
    if (raw === undefined) {
      return undefined;
    }
    const rule = this.cache.get(raw);
    const i = binarySearch(rule.minutes, true, minutes);
    return rule.keys[i];
  }

@phensley/cldr-utils

Utilities for cldr-engine packages

Apache-2.0
Latest version published 17 days ago

Package Health Score

60 / 100
Full package analysis

Similar packages