@formatjs/intl-durationformat 0.10.11 → 0.10.13
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.js +0 -1
- package/index.js.map +1 -1
- package/package.json +2 -2
- package/polyfill-force.js +18 -6
- package/polyfill-force.js.map +1 -1
- package/polyfill.js +19 -6
- package/polyfill.js.map +1 -1
- package/should-polyfill.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-durationformat",
|
|
3
3
|
"description": "Intl.DurationFormat polyfill",
|
|
4
|
-
"version": "0.10.
|
|
4
|
+
"version": "0.10.13",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Long Ho <holevietlong@gmail.com>",
|
|
7
7
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@formatjs/bigdecimal": "0.2.5",
|
|
17
|
-
"@formatjs/intl-localematcher": "0.8.
|
|
17
|
+
"@formatjs/intl-localematcher": "0.8.9"
|
|
18
18
|
},
|
|
19
19
|
"bugs": "https://github.com/formatjs/formatjs/issues",
|
|
20
20
|
"homepage": "https://github.com/formatjs/formatjs#readme",
|
package/polyfill-force.js
CHANGED
|
@@ -178,12 +178,28 @@ const strategies = {
|
|
|
178
178
|
};
|
|
179
179
|
//#endregion
|
|
180
180
|
//#region packages/ecma402-abstract/utils.js
|
|
181
|
+
function defineProperty(target, name, { value }) {
|
|
182
|
+
Object.defineProperty(target, name, {
|
|
183
|
+
configurable: true,
|
|
184
|
+
enumerable: false,
|
|
185
|
+
writable: true,
|
|
186
|
+
value
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
function ensureIntl() {
|
|
190
|
+
if (typeof Intl === "undefined") Object.defineProperty(globalThis, "Intl", {
|
|
191
|
+
configurable: true,
|
|
192
|
+
enumerable: false,
|
|
193
|
+
writable: true,
|
|
194
|
+
value: {}
|
|
195
|
+
});
|
|
196
|
+
return Intl;
|
|
197
|
+
}
|
|
181
198
|
function invariant$2(condition, message, Err = Error) {
|
|
182
199
|
if (!condition) throw new Err(message);
|
|
183
200
|
}
|
|
184
201
|
const createMemoizedNumberFormat = memoize((...args) => new Intl.NumberFormat(...args), { strategy: strategies.variadic });
|
|
185
202
|
memoize((...args) => new Intl.PluralRules(...args), { strategy: strategies.variadic });
|
|
186
|
-
memoize((...args) => new Intl.Locale(...args), { strategy: strategies.variadic });
|
|
187
203
|
const createMemoizedListFormat = memoize((...args) => new Intl.ListFormat(...args), { strategy: strategies.variadic });
|
|
188
204
|
//#endregion
|
|
189
205
|
//#region packages/ecma402-abstract/DurationFormat/GetDurationUnitOptions.js
|
|
@@ -1716,11 +1732,7 @@ var DurationFormat = class DurationFormat {
|
|
|
1716
1732
|
};
|
|
1717
1733
|
//#endregion
|
|
1718
1734
|
//#region packages/intl-durationformat/polyfill-force.ts
|
|
1719
|
-
|
|
1720
|
-
if (typeof window !== "undefined") Object.defineProperty(window, "Intl", { value: {} });
|
|
1721
|
-
else if (typeof global !== "undefined") Object.defineProperty(global, "Intl", { value: {} });
|
|
1722
|
-
}
|
|
1723
|
-
Object.defineProperty(Intl, "DurationFormat", { value: DurationFormat });
|
|
1735
|
+
defineProperty(ensureIntl(), "DurationFormat", { value: DurationFormat });
|
|
1724
1736
|
//#endregion
|
|
1725
1737
|
|
|
1726
1738
|
//# sourceMappingURL=polyfill-force.js.map
|