@formatjs/intl-locale 3.0.1 → 3.0.4

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.
Files changed (45) hide show
  1. package/BUILD +132 -0
  2. package/CHANGELOG.md +436 -0
  3. package/LICENSE.md +0 -0
  4. package/README.md +0 -0
  5. package/get_internal_slots.ts +15 -0
  6. package/index.ts +529 -0
  7. package/package.json +4 -4
  8. package/polyfill-force.ts +8 -0
  9. package/polyfill.ts +10 -0
  10. package/should-polyfill.ts +14 -0
  11. package/tests/index.test.ts +18 -0
  12. package/tests/likely-subtags.test.ts +108 -0
  13. package/tests/minimize.test.ts +35 -0
  14. package/tsconfig.json +5 -0
  15. package/get_internal_slots.d.ts +0 -3
  16. package/get_internal_slots.d.ts.map +0 -1
  17. package/get_internal_slots.js +0 -14
  18. package/index.d.ts +0 -49
  19. package/index.d.ts.map +0 -1
  20. package/index.js +0 -394
  21. package/lib/get_internal_slots.d.ts +0 -3
  22. package/lib/get_internal_slots.d.ts.map +0 -1
  23. package/lib/get_internal_slots.js +0 -11
  24. package/lib/index.d.ts +0 -49
  25. package/lib/index.d.ts.map +0 -1
  26. package/lib/index.js +0 -391
  27. package/lib/polyfill-force.d.ts +0 -2
  28. package/lib/polyfill-force.d.ts.map +0 -1
  29. package/lib/polyfill-force.js +0 -7
  30. package/lib/polyfill.d.ts +0 -2
  31. package/lib/polyfill.d.ts.map +0 -1
  32. package/lib/polyfill.js +0 -10
  33. package/lib/should-polyfill.d.ts +0 -2
  34. package/lib/should-polyfill.d.ts.map +0 -1
  35. package/lib/should-polyfill.js +0 -14
  36. package/polyfill-force.d.ts +0 -2
  37. package/polyfill-force.d.ts.map +0 -1
  38. package/polyfill-force.js +0 -9
  39. package/polyfill.d.ts +0 -2
  40. package/polyfill.d.ts.map +0 -1
  41. package/polyfill.iife.js +0 -6468
  42. package/polyfill.js +0 -12
  43. package/should-polyfill.d.ts +0 -2
  44. package/should-polyfill.d.ts.map +0 -1
  45. package/should-polyfill.js +0 -18
package/polyfill.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- var _1 = require("./");
4
- var should_polyfill_1 = require("./should-polyfill");
5
- if ((0, should_polyfill_1.shouldPolyfill)()) {
6
- Object.defineProperty(Intl, 'Locale', {
7
- value: _1.Locale,
8
- writable: true,
9
- enumerable: false,
10
- configurable: true,
11
- });
12
- }
@@ -1,2 +0,0 @@
1
- export declare function shouldPolyfill(): boolean;
2
- //# sourceMappingURL=should-polyfill.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"should-polyfill.d.ts","sourceRoot":"","sources":["../../../../../packages/intl-locale/should-polyfill.ts"],"names":[],"mappings":"AAWA,wBAAgB,cAAc,YAE7B"}
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.shouldPolyfill = void 0;
4
- /**
5
- * https://bugs.chromium.org/p/v8/issues/detail?id=10682
6
- */
7
- function hasIntlGetCanonicalLocalesBug() {
8
- try {
9
- return new Intl.Locale('und-x-private').toString() === 'x-private';
10
- }
11
- catch (e) {
12
- return true;
13
- }
14
- }
15
- function shouldPolyfill() {
16
- return !('Locale' in Intl) || hasIntlGetCanonicalLocalesBug();
17
- }
18
- exports.shouldPolyfill = shouldPolyfill;