@formatjs/intl-getcanonicallocales 2.0.5 → 2.1.0

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.
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=polyfill-force.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill-force.d.ts","sourceRoot":"","sources":["../polyfill-force.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ import { getCanonicalLocales } from './';
2
+ if (typeof Intl === 'undefined') {
3
+ if (typeof window !== 'undefined') {
4
+ Object.defineProperty(window, 'Intl', {
5
+ value: {},
6
+ });
7
+ // @ts-ignore we don't include @types/node so global isn't a thing
8
+ }
9
+ else if (typeof global !== 'undefined') {
10
+ // @ts-ignore we don't include @types/node so global isn't a thing
11
+ Object.defineProperty(global, 'Intl', {
12
+ value: {},
13
+ });
14
+ }
15
+ }
16
+ Object.defineProperty(Intl, 'getCanonicalLocales', {
17
+ value: getCanonicalLocales,
18
+ writable: true,
19
+ enumerable: false,
20
+ configurable: true,
21
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formatjs/intl-getcanonicallocales",
3
- "version": "2.0.5",
3
+ "version": "2.1.0",
4
4
  "description": "Intl.getCanonicalLocales polyfill",
5
5
  "keywords": [
6
6
  "intl",
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=polyfill-force.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"polyfill-force.d.ts","sourceRoot":"","sources":["polyfill-force.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var _1 = require("./");
4
+ if (typeof Intl === 'undefined') {
5
+ if (typeof window !== 'undefined') {
6
+ Object.defineProperty(window, 'Intl', {
7
+ value: {},
8
+ });
9
+ // @ts-ignore we don't include @types/node so global isn't a thing
10
+ }
11
+ else if (typeof global !== 'undefined') {
12
+ // @ts-ignore we don't include @types/node so global isn't a thing
13
+ Object.defineProperty(global, 'Intl', {
14
+ value: {},
15
+ });
16
+ }
17
+ }
18
+ Object.defineProperty(Intl, 'getCanonicalLocales', {
19
+ value: _1.getCanonicalLocales,
20
+ writable: true,
21
+ enumerable: false,
22
+ configurable: true,
23
+ });
package/polyfill.iife.js CHANGED
@@ -21,9 +21,9 @@
21
21
  mod
22
22
  ));
23
23
 
24
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.js
24
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.js
25
25
  var require_tslib = __commonJS({
26
- "../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.js"(exports, module) {
26
+ "../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/tslib.js"(exports, module) {
27
27
  var __extends2;
28
28
  var __assign2;
29
29
  var __rest2;
@@ -461,7 +461,7 @@
461
461
  }
462
462
  });
463
463
 
464
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/modules/index.js
464
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/node_modules/.aspect_rules_js/tslib@2.4.0/node_modules/tslib/modules/index.js
465
465
  var import_tslib = __toESM(require_tslib(), 1);
466
466
  var {
467
467
  __extends,
@@ -491,7 +491,7 @@
491
491
  __classPrivateFieldIn
492
492
  } = import_tslib.default;
493
493
 
494
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/parser.js
494
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/parser.js
495
495
  var ALPHANUM_1_8 = /^[a-z0-9]{1,8}$/i;
496
496
  var ALPHANUM_2_8 = /^[a-z0-9]{2,8}$/i;
497
497
  var ALPHANUM_3_8 = /^[a-z0-9]{3,8}$/i;
@@ -708,7 +708,7 @@
708
708
  return __assign({ lang }, parseExtensions(chunks));
709
709
  }
710
710
 
711
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/emitter.js
711
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/emitter.js
712
712
  function emitUnicodeLanguageId(lang) {
713
713
  if (!lang) {
714
714
  return "";
@@ -740,7 +740,7 @@
740
740
  return chunks.filter(Boolean).join("-");
741
741
  }
742
742
 
743
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/aliases.generated.js
743
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/aliases.generated.js
744
744
  var languageAlias = {
745
745
  "aa-saaho": "ssy",
746
746
  "aam": "aas",
@@ -1877,7 +1877,7 @@
1877
1877
  "polytoni": "polyton"
1878
1878
  };
1879
1879
 
1880
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/likelySubtags.generated.js
1880
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/likelySubtags.generated.js
1881
1881
  var likelySubtags = {
1882
1882
  "aa": "aa-Latn-ET",
1883
1883
  "aai": "aai-Latn-ZZ",
@@ -3747,7 +3747,7 @@
3747
3747
  "zza": "zza-Latn-TR"
3748
3748
  };
3749
3749
 
3750
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/canonicalizer.js
3750
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/src/canonicalizer.js
3751
3751
  function canonicalizeAttrs(strs) {
3752
3752
  return Object.keys(strs.reduce(function(all, str) {
3753
3753
  all[str.toLowerCase()] = 1;
@@ -3928,7 +3928,7 @@
3928
3928
  return locale;
3929
3929
  }
3930
3930
 
3931
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/index.js
3931
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/index.js
3932
3932
  function CanonicalizeLocaleList(locales) {
3933
3933
  if (locales === void 0) {
3934
3934
  return [];
@@ -3950,12 +3950,12 @@
3950
3950
  return CanonicalizeLocaleList(locales);
3951
3951
  }
3952
3952
 
3953
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/should-polyfill.js
3953
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/should-polyfill.js
3954
3954
  function shouldPolyfill() {
3955
3955
  return typeof Intl === "undefined" || !("getCanonicalLocales" in Intl) || Intl.getCanonicalLocales("und-x-private")[0] === "x-private";
3956
3956
  }
3957
3957
 
3958
- // ../../../../../../../../execroot/formatjs/bazel-out/darwin_arm64-fastbuild/bin/packages/intl-getcanonicallocales/lib/polyfill.js
3958
+ // ../../../../../../../../execroot/formatjs/bazel-out/darwin-fastbuild/bin/packages/intl-getcanonicallocales/lib/polyfill.js
3959
3959
  if (typeof Intl === "undefined") {
3960
3960
  if (typeof window !== "undefined") {
3961
3961
  Object.defineProperty(window, "Intl", {