@formatjs/intl-durationformat 0.10.10 → 0.10.12
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.map +1 -1
- package/package.json +3 -3
- package/polyfill-force.js +18 -5
- package/polyfill-force.js.map +1 -1
- package/polyfill.js +19 -5
- package/polyfill.js.map +1 -1
- package/should-polyfill.js.map +1 -1
package/polyfill.js
CHANGED
|
@@ -178,6 +178,23 @@ 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
|
}
|
|
@@ -1721,11 +1738,8 @@ function shouldPolyfill() {
|
|
|
1721
1738
|
}
|
|
1722
1739
|
//#endregion
|
|
1723
1740
|
//#region packages/intl-durationformat/polyfill.ts
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
else if (typeof global !== "undefined") Object.defineProperty(global, "Intl", { value: {} });
|
|
1727
|
-
}
|
|
1728
|
-
if (shouldPolyfill()) Object.defineProperty(Intl, "DurationFormat", { value: DurationFormat });
|
|
1741
|
+
const intl = ensureIntl();
|
|
1742
|
+
if (shouldPolyfill()) defineProperty(intl, "DurationFormat", { value: DurationFormat });
|
|
1729
1743
|
//#endregion
|
|
1730
1744
|
|
|
1731
1745
|
//# sourceMappingURL=polyfill.js.map
|