@formatjs/intl-locale 5.3.7 → 5.3.9

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/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@formatjs/intl-locale",
3
+ "version": "5.3.9",
3
4
  "description": "Intl.Locale polyfill",
4
- "version": "5.3.7",
5
+ "keywords": [
6
+ "ecma402",
7
+ "formatjs",
8
+ "i18n",
9
+ "intl",
10
+ "locale",
11
+ "react-intl",
12
+ "tc39"
13
+ ],
14
+ "homepage": "https://github.com/formatjs/formatjs#readme",
15
+ "bugs": "https://github.com/formatjs/formatjs/issues",
5
16
  "license": "MIT",
6
17
  "author": "Long Ho <holevietlong@gmail.com>",
18
+ "repository": "formatjs/formatjs.git",
7
19
  "type": "module",
8
20
  "types": "index.d.ts",
9
21
  "exports": {
10
22
  ".": "./index.js",
11
- "./polyfill.js": "./polyfill.js",
12
23
  "./polyfill-force.js": "./polyfill-force.js",
24
+ "./polyfill.js": "./polyfill.js",
13
25
  "./should-polyfill.js": "./should-polyfill.js"
14
26
  },
15
27
  "dependencies": {
16
- "@formatjs/intl-getcanonicallocales": "3.2.8",
17
- "@formatjs/intl-supportedvaluesof": "2.3.6"
18
- },
19
- "bugs": "https://github.com/formatjs/formatjs/issues",
20
- "homepage": "https://github.com/formatjs/formatjs#readme",
21
- "keywords": [
22
- "ecma402",
23
- "formatjs",
24
- "i18n",
25
- "intl",
26
- "locale",
27
- "react-intl",
28
- "tc39"
29
- ],
30
- "repository": "formatjs/formatjs.git"
28
+ "@formatjs/intl-getcanonicallocales": "3.2.10",
29
+ "@formatjs/intl-supportedvaluesof": "2.3.8"
30
+ }
31
31
  }
package/polyfill-force.js CHANGED
@@ -136,6 +136,23 @@ const strategies = {
136
136
  };
137
137
  //#endregion
138
138
  //#region packages/ecma402-abstract/utils.js
139
+ function defineProperty(target, name, { value }) {
140
+ Object.defineProperty(target, name, {
141
+ configurable: true,
142
+ enumerable: false,
143
+ writable: true,
144
+ value
145
+ });
146
+ }
147
+ function ensureIntl() {
148
+ if (typeof Intl === "undefined") Object.defineProperty(globalThis, "Intl", {
149
+ configurable: true,
150
+ enumerable: false,
151
+ writable: true,
152
+ value: {}
153
+ });
154
+ return Intl;
155
+ }
139
156
  /**
140
157
  * 7.3.5 CreateDataProperty
141
158
  * @param target
@@ -155,7 +172,6 @@ function invariant(condition, message, Err = Error) {
155
172
  }
156
173
  memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
157
174
  memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
158
- memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });
159
175
  memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
160
176
  //#endregion
161
177
  //#region node_modules/.aspect_rules_js/@formatjs_generated+cldr.locale@0.0.0/node_modules/@formatjs_generated/cldr.locale/character-orders.js
@@ -4664,12 +4680,7 @@ try {
4664
4680
  } catch {}
4665
4681
  //#endregion
4666
4682
  //#region packages/intl-locale/polyfill-force.ts
4667
- Object.defineProperty(Intl, "Locale", {
4668
- value: Locale,
4669
- writable: true,
4670
- enumerable: false,
4671
- configurable: true
4672
- });
4683
+ defineProperty(ensureIntl(), "Locale", { value: Locale });
4673
4684
  //#endregion
4674
4685
 
4675
4686
  //# sourceMappingURL=polyfill-force.js.map