@formatjs/intl-localematcher 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export interface Opts {
2
- algorithm: 'lookup' | 'best fit';
2
+ algorithm: "lookup" | "best fit";
3
3
  }
4
4
  export declare function match(requestedLocales: readonly string[], availableLocales: readonly string[], defaultLocale: string, opts?: Opts): string;
5
- export { LookupSupportedLocales } from './abstract/LookupSupportedLocales.js';
6
- export { ResolveLocale } from './abstract/ResolveLocale.js';
5
+ export { LookupSupportedLocales } from "./abstract/LookupSupportedLocales.js";
6
+ export { ResolveLocale } from "./abstract/ResolveLocale.js";
package/index.js CHANGED
@@ -1,9 +1,7 @@
1
- import { CanonicalizeLocaleList } from './abstract/CanonicalizeLocaleList.js';
2
- import { ResolveLocale } from './abstract/ResolveLocale.js';
1
+ import { CanonicalizeLocaleList } from "./abstract/CanonicalizeLocaleList.js";
2
+ import { ResolveLocale } from "./abstract/ResolveLocale.js";
3
3
  export function match(requestedLocales, availableLocales, defaultLocale, opts) {
4
- return ResolveLocale(availableLocales, CanonicalizeLocaleList(requestedLocales), {
5
- localeMatcher: (opts === null || opts === void 0 ? void 0 : opts.algorithm) || 'best fit',
6
- }, [], {}, function () { return defaultLocale; }).locale;
4
+ return ResolveLocale(availableLocales, CanonicalizeLocaleList(requestedLocales), { localeMatcher: opts?.algorithm || "best fit" }, [], {}, () => defaultLocale).locale;
7
5
  }
8
- export { LookupSupportedLocales } from './abstract/LookupSupportedLocales.js';
9
- export { ResolveLocale } from './abstract/ResolveLocale.js';
6
+ export { LookupSupportedLocales } from "./abstract/LookupSupportedLocales.js";
7
+ export { ResolveLocale } from "./abstract/ResolveLocale.js";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formatjs/intl-localematcher",
3
3
  "description": "Intl.LocaleMatcher ponyfill",
4
- "version": "0.7.3",
4
+ "version": "0.7.5",
5
5
  "license": "MIT",
6
6
  "author": "Long Ho <holevietlong@gmail.com>",
7
7
  "type": "module",
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "tslib": "^2.8.0",
15
- "@formatjs/fast-memoize": "3.0.1"
15
+ "@formatjs/fast-memoize": "3.0.3"
16
16
  },
17
17
  "bugs": "https://github.com/formatjs/formatjs/issues",
18
18
  "homepage": "https://github.com/formatjs/formatjs#readme",