@formatjs/intl-getcanonicallocales 2.0.3 → 2.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.
- package/index.d.ts +6 -0
- package/index.d.ts.map +1 -0
- package/index.js +42 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +31 -0
- package/lib/polyfill.d.ts +2 -0
- package/lib/polyfill.d.ts.map +1 -0
- package/lib/polyfill.js +24 -0
- package/lib/should-polyfill.d.ts +2 -0
- package/lib/should-polyfill.d.ts.map +1 -0
- package/lib/should-polyfill.js +8 -0
- package/lib/src/aliases.generated.d.ts +5 -0
- package/lib/src/aliases.generated.d.ts.map +1 -0
- package/lib/src/aliases.generated.js +1137 -0
- package/lib/src/canonicalizer.d.ts +20 -0
- package/lib/src/canonicalizer.d.ts.map +1 -0
- package/lib/src/canonicalizer.js +219 -0
- package/lib/src/emitter.d.ts +4 -0
- package/lib/src/emitter.d.ts.map +1 -0
- package/lib/src/emitter.js +28 -0
- package/lib/src/likelySubtags.generated.d.ts +2 -0
- package/lib/src/likelySubtags.generated.d.ts.map +1 -0
- package/lib/src/likelySubtags.generated.js +1870 -0
- package/lib/src/parser.d.ts +10 -0
- package/lib/src/parser.d.ts.map +1 -0
- package/lib/src/parser.js +233 -0
- package/lib/src/types.d.ts +33 -0
- package/lib/src/types.d.ts.map +1 -0
- package/lib/src/types.js +1 -0
- package/package.json +1 -1
- package/polyfill.d.ts +2 -0
- package/polyfill.d.ts.map +1 -0
- package/polyfill.iife.js +3512 -0
- package/polyfill.js +26 -0
- package/should-polyfill.d.ts +2 -0
- package/should-polyfill.d.ts.map +1 -0
- package/should-polyfill.js +12 -0
- package/src/aliases.generated.d.ts +5 -0
- package/src/aliases.generated.d.ts.map +1 -0
- package/src/aliases.generated.js +1140 -0
- package/src/canonicalizer.d.ts +20 -0
- package/src/canonicalizer.d.ts.map +1 -0
- package/src/canonicalizer.js +224 -0
- package/src/emitter.d.ts +4 -0
- package/src/emitter.d.ts.map +1 -0
- package/src/emitter.js +33 -0
- package/src/likelySubtags.generated.d.ts +2 -0
- package/src/likelySubtags.generated.d.ts.map +1 -0
- package/src/likelySubtags.generated.js +1873 -0
- package/src/parser.d.ts +10 -0
- package/src/parser.d.ts.map +1 -0
- package/src/parser.js +243 -0
- package/src/types.d.ts +33 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.js +2 -0
- package/BUILD +0 -116
- package/CHANGELOG.md +0 -290
- package/index.ts +0 -43
- package/polyfill.ts +0 -23
- package/scripts/aliases.ts +0 -70
- package/scripts/likely-subtags.ts +0 -20
- package/should-polyfill.ts +0 -10
- package/src/aliases.generated.ts +0 -1137
- package/src/canonicalizer.ts +0 -272
- package/src/emitter.ts +0 -39
- package/src/likelySubtags.generated.ts +0 -1870
- package/src/parser.ts +0 -259
- package/src/types.ts +0 -63
- package/tests/index.test.ts +0 -24
- package/tests/parser.test.ts +0 -204
- package/tsconfig.json +0 -5
package/CHANGELOG.md
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [2.0.3](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@2.0.2...@formatjs/intl-getcanonicallocales@2.0.3) (2022-08-18)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
9
|
-
|
|
10
|
-
## [2.0.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@2.0.1...@formatjs/intl-getcanonicallocales@2.0.2) (2022-06-06)
|
|
11
|
-
|
|
12
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
13
|
-
|
|
14
|
-
## [2.0.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@2.0.0...@formatjs/intl-getcanonicallocales@2.0.1) (2022-05-19)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
17
|
-
|
|
18
|
-
# [2.0.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.9.2...@formatjs/intl-getcanonicallocales@2.0.0) (2022-05-19)
|
|
19
|
-
|
|
20
|
-
### Bug Fixes
|
|
21
|
-
|
|
22
|
-
* **react-intl:** fix type issue with react18, fix [#3550](https://github.com/formatjs/formatjs/issues/3550) ([2567b93](https://github.com/formatjs/formatjs/commit/2567b932c5d18b097a43842563046c20ce0c49f1))
|
|
23
|
-
|
|
24
|
-
### Features
|
|
25
|
-
|
|
26
|
-
* **@formatjs/cli:** package CLI into a single file ([1760787](https://github.com/formatjs/formatjs/commit/176078792894d18b0af72ce1f413f25835f7eb44)), closes [#3547](https://github.com/formatjs/formatjs/issues/3547)
|
|
27
|
-
|
|
28
|
-
### BREAKING CHANGES
|
|
29
|
-
|
|
30
|
-
* **@formatjs/cli:** we push @vue/compiler-core out to `peerDependencies` so if u use vue u should pull this in manuallywip on packaging cli.
|
|
31
|
-
|
|
32
|
-
## [1.9.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.9.1...@formatjs/intl-getcanonicallocales@1.9.2) (2022-03-26)
|
|
33
|
-
|
|
34
|
-
### Bug Fixes
|
|
35
|
-
|
|
36
|
-
* **@formatjs/intl-getcanonicallocales:** rm @types/node dep, fix [#3474](https://github.com/formatjs/formatjs/issues/3474) ([587e0f1](https://github.com/formatjs/formatjs/commit/587e0f1a5563a9ba0effceb2801fb11e0061be11))
|
|
37
|
-
|
|
38
|
-
## [1.9.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.9.0...@formatjs/intl-getcanonicallocales@1.9.1) (2022-03-13)
|
|
39
|
-
|
|
40
|
-
### Bug Fixes
|
|
41
|
-
|
|
42
|
-
* **@formatjs/intl-getcanonicallocales:** add peerDependenciesMeta field ([#3415](https://github.com/formatjs/formatjs/issues/3415)) ([d5a7b90](https://github.com/formatjs/formatjs/commit/d5a7b900f806f0ca51007ca86a13a42918db3a1c))
|
|
43
|
-
|
|
44
|
-
# [1.9.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.8.0...@formatjs/intl-getcanonicallocales@1.9.0) (2022-01-09)
|
|
45
|
-
|
|
46
|
-
### Features
|
|
47
|
-
|
|
48
|
-
* **@formatjs/intl-getcanonicallocales:** upgrade cldr to v40 ([70f61fc](https://github.com/formatjs/formatjs/commit/70f61fcf5e64b4aa6a34eeae7bdb8af05527ef34))
|
|
49
|
-
|
|
50
|
-
# [1.8.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.7.3...@formatjs/intl-getcanonicallocales@1.8.0) (2021-10-22)
|
|
51
|
-
|
|
52
|
-
### Features
|
|
53
|
-
|
|
54
|
-
* **@formatjs/intl-getcanonicallocales:** upgrade to TS 4.4 ([8b9b381](https://github.com/formatjs/formatjs/commit/8b9b38121f42d35edb189d94fef4a4f03da0871a))
|
|
55
|
-
|
|
56
|
-
## [1.7.3](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.7.2...@formatjs/intl-getcanonicallocales@1.7.3) (2021-08-15)
|
|
57
|
-
|
|
58
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
59
|
-
|
|
60
|
-
## [1.7.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.7.1...@formatjs/intl-getcanonicallocales@1.7.2) (2021-08-06)
|
|
61
|
-
|
|
62
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
63
|
-
|
|
64
|
-
## [1.7.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.7.0...@formatjs/intl-getcanonicallocales@1.7.1) (2021-06-26)
|
|
65
|
-
|
|
66
|
-
### Bug Fixes
|
|
67
|
-
|
|
68
|
-
* **@formatjs/intl-getcanonicallocales:** rm json import to be more ESM-friendly, fix [#2961](https://github.com/formatjs/formatjs/issues/2961) ([9d491e2](https://github.com/formatjs/formatjs/commit/9d491e2b0ac4ae50cda39a0c59b991c9c663d565))
|
|
69
|
-
|
|
70
|
-
# [1.7.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.6.0...@formatjs/intl-getcanonicallocales@1.7.0) (2021-05-20)
|
|
71
|
-
|
|
72
|
-
### Features
|
|
73
|
-
|
|
74
|
-
* **@formatjs/ecma-376:** new package that generate ecma-376 numFmt pattern ([2a57d16](https://github.com/formatjs/formatjs/commit/2a57d1676f8fc840915b2750a5469934dfd765e8)), closes [#2885](https://github.com/formatjs/formatjs/issues/2885)
|
|
75
|
-
|
|
76
|
-
# [1.6.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.11...@formatjs/intl-getcanonicallocales@1.6.0) (2021-05-17)
|
|
77
|
-
|
|
78
|
-
### Features
|
|
79
|
-
|
|
80
|
-
* **@formatjs/intl-getcanonicallocales:** upgrade unicode to v39 ([ee3a069](https://github.com/formatjs/formatjs/commit/ee3a0694bb9e5418cbd04664016b47fc5b0e079c))
|
|
81
|
-
|
|
82
|
-
## [1.5.11](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.10...@formatjs/intl-getcanonicallocales@1.5.11) (2021-05-14)
|
|
83
|
-
|
|
84
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
85
|
-
|
|
86
|
-
## [1.5.10](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.9...@formatjs/intl-getcanonicallocales@1.5.10) (2021-05-10)
|
|
87
|
-
|
|
88
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
89
|
-
|
|
90
|
-
## [1.5.9](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.8...@formatjs/intl-getcanonicallocales@1.5.9) (2021-04-12)
|
|
91
|
-
|
|
92
|
-
### Bug Fixes
|
|
93
|
-
|
|
94
|
-
* **@formatjs/intl-getcanonicallocales:** check for chunks length before regex, [#2813](https://github.com/formatjs/formatjs/issues/2813) ([89b40b9](https://github.com/formatjs/formatjs/commit/89b40b9aa0c9c2a64ab14a596404d91bf93d6cac))
|
|
95
|
-
|
|
96
|
-
## [1.5.8](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.7...@formatjs/intl-getcanonicallocales@1.5.8) (2021-03-26)
|
|
97
|
-
|
|
98
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
99
|
-
|
|
100
|
-
## [1.5.7](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.6...@formatjs/intl-getcanonicallocales@1.5.7) (2021-03-15)
|
|
101
|
-
|
|
102
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
103
|
-
|
|
104
|
-
## [1.5.6](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.5...@formatjs/intl-getcanonicallocales@1.5.6) (2021-03-01)
|
|
105
|
-
|
|
106
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
107
|
-
|
|
108
|
-
## [1.5.5](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.4...@formatjs/intl-getcanonicallocales@1.5.5) (2021-02-25)
|
|
109
|
-
|
|
110
|
-
### Bug Fixes
|
|
111
|
-
|
|
112
|
-
* bump tslib version dep ([37577d2](https://github.com/formatjs/formatjs/commit/37577d22bf28d23de1d8013ba0047cf221ad8840)), closes [#2645](https://github.com/formatjs/formatjs/issues/2645)
|
|
113
|
-
|
|
114
|
-
## [1.5.4](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.3...@formatjs/intl-getcanonicallocales@1.5.4) (2021-02-25)
|
|
115
|
-
|
|
116
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
117
|
-
|
|
118
|
-
## [1.5.3](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.2...@formatjs/intl-getcanonicallocales@1.5.3) (2020-12-16)
|
|
119
|
-
|
|
120
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
121
|
-
|
|
122
|
-
## [1.5.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.1...@formatjs/intl-getcanonicallocales@1.5.2) (2020-11-26)
|
|
123
|
-
|
|
124
|
-
### Bug Fixes
|
|
125
|
-
|
|
126
|
-
* **@formatjs/intl-getcanonicallocales:** fix import path for polyfills ([#2348](https://github.com/formatjs/formatjs/issues/2348)) ([c704cf5](https://github.com/formatjs/formatjs/commit/c704cf5561c659ab1552c1c0efd76616c822da6f))
|
|
127
|
-
|
|
128
|
-
## [1.5.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.5.0...@formatjs/intl-getcanonicallocales@1.5.1) (2020-10-26)
|
|
129
|
-
|
|
130
|
-
### Bug Fixes
|
|
131
|
-
|
|
132
|
-
* **@formatjs/intl-getcanonicallocales:** fix UMD bundle ([c0362f5](https://github.com/formatjs/formatjs/commit/c0362f5243e663d1ac4efb011e8b4919d9dec1c1))
|
|
133
|
-
|
|
134
|
-
# [1.5.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.6...@formatjs/intl-getcanonicallocales@1.5.0) (2020-10-25)
|
|
135
|
-
|
|
136
|
-
### Features
|
|
137
|
-
|
|
138
|
-
* **@formatjs/intl-getcanonicallocales:** upgrade cldr to v37 ([53540af](https://github.com/formatjs/formatjs/commit/53540af06ef06e639443223170adf4cab7e308e0))
|
|
139
|
-
|
|
140
|
-
## [1.4.6](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.5...@formatjs/intl-getcanonicallocales@1.4.6) (2020-10-01)
|
|
141
|
-
|
|
142
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
143
|
-
|
|
144
|
-
## [1.4.5](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.4...@formatjs/intl-getcanonicallocales@1.4.5) (2020-09-18)
|
|
145
|
-
|
|
146
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
147
|
-
|
|
148
|
-
## [1.4.4](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.3...@formatjs/intl-getcanonicallocales@1.4.4) (2020-09-09)
|
|
149
|
-
|
|
150
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
151
|
-
|
|
152
|
-
## [1.4.3](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.2...@formatjs/intl-getcanonicallocales@1.4.3) (2020-08-25)
|
|
153
|
-
|
|
154
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
155
|
-
|
|
156
|
-
## [1.4.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.1...@formatjs/intl-getcanonicallocales@1.4.2) (2020-08-21)
|
|
157
|
-
|
|
158
|
-
### Bug Fixes
|
|
159
|
-
|
|
160
|
-
* add back polyfill.umd, fix [#2013](https://github.com/formatjs/formatjs/issues/2013) ([b9cfbd2](https://github.com/formatjs/formatjs/commit/b9cfbd2eeead6a5165b0e4cbf1ef3edbfbeca8ce))
|
|
161
|
-
|
|
162
|
-
## [1.4.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.4.0...@formatjs/intl-getcanonicallocales@1.4.1) (2020-08-19)
|
|
163
|
-
|
|
164
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
165
|
-
|
|
166
|
-
# [1.4.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.3.2...@formatjs/intl-getcanonicallocales@1.4.0) (2020-08-18)
|
|
167
|
-
|
|
168
|
-
### Features
|
|
169
|
-
|
|
170
|
-
* **@formatjs/intl-getcanonicallocales:** expose shouldPolyfill to detect if platform needs our polyfill ([ba0aac6](https://github.com/formatjs/formatjs/commit/ba0aac6dda7053a5b4ffb8f6502dd8c1688cbc8f))
|
|
171
|
-
|
|
172
|
-
## [1.3.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.3.1...@formatjs/intl-getcanonicallocales@1.3.2) (2020-08-14)
|
|
173
|
-
|
|
174
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
175
|
-
|
|
176
|
-
## [1.3.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.3.0...@formatjs/intl-getcanonicallocales@1.3.1) (2020-07-24)
|
|
177
|
-
|
|
178
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
179
|
-
|
|
180
|
-
# [1.3.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.10...@formatjs/intl-getcanonicallocales@1.3.0) (2020-07-14)
|
|
181
|
-
|
|
182
|
-
### Features
|
|
183
|
-
|
|
184
|
-
* publish ([b6e3465](https://github.com/formatjs/formatjs/commit/b6e3465ac95b3fa481f3c89f077a66ac004f7c27))
|
|
185
|
-
|
|
186
|
-
## [1.2.11](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.10...@formatjs/intl-getcanonicallocales@1.2.11) (2020-07-09)
|
|
187
|
-
|
|
188
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
189
|
-
|
|
190
|
-
## [1.2.10](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.8...@formatjs/intl-getcanonicallocales@1.2.10) (2020-07-03)
|
|
191
|
-
|
|
192
|
-
### Bug Fixes
|
|
193
|
-
|
|
194
|
-
* **@formatjs/intl-getcanonicallocales:** re-publish ([1528d6d](https://github.com/formatjs/formatjs/commit/1528d6d1326ca993f8df1a3e63817e2ed25ba219))
|
|
195
|
-
|
|
196
|
-
## [1.2.8](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.7...@formatjs/intl-getcanonicallocales@1.2.8) (2020-07-03)
|
|
197
|
-
|
|
198
|
-
### Bug Fixes
|
|
199
|
-
|
|
200
|
-
* add locale-data to package.json files ([52a1481](https://github.com/formatjs/formatjs/commit/52a148196585bf8b33b27b9b948d6333f49072e8))
|
|
201
|
-
|
|
202
|
-
## [1.2.7](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.6...@formatjs/intl-getcanonicallocales@1.2.7) (2020-07-01)
|
|
203
|
-
|
|
204
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
205
|
-
|
|
206
|
-
## [1.2.6](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.5...@formatjs/intl-getcanonicallocales@1.2.6) (2020-06-06)
|
|
207
|
-
|
|
208
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
209
|
-
|
|
210
|
-
## [1.2.5](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.4...@formatjs/intl-getcanonicallocales@1.2.5) (2020-06-06)
|
|
211
|
-
|
|
212
|
-
### Bug Fixes
|
|
213
|
-
|
|
214
|
-
* **@formatjs/intl-getcanonicallocales:** handle non-existent Intl object ([b488ee8](https://github.com/formatjs/formatjs/commit/b488ee88b8ccab854b738ba4ad9c3947058121a1))
|
|
215
|
-
|
|
216
|
-
## [1.2.4](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.3...@formatjs/intl-getcanonicallocales@1.2.4) (2020-05-28)
|
|
217
|
-
|
|
218
|
-
### Bug Fixes
|
|
219
|
-
|
|
220
|
-
* **@formatjs/intl-utils:** Add missing cldr-core to package.json dep ([d0b72fe](https://github.com/formatjs/formatjs/commit/d0b72fe398c7017d03e8ee66c98ad88fe3e47657))
|
|
221
|
-
|
|
222
|
-
## [1.2.3](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.2...@formatjs/intl-getcanonicallocales@1.2.3) (2020-05-27)
|
|
223
|
-
|
|
224
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
225
|
-
|
|
226
|
-
## [1.2.2](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.1...@formatjs/intl-getcanonicallocales@1.2.2) (2020-05-25)
|
|
227
|
-
|
|
228
|
-
### Bug Fixes
|
|
229
|
-
|
|
230
|
-
* **@formatjs/intl-getcanonicallocales:** fix alias lookup algo ([b39e3c2](https://github.com/formatjs/formatjs/commit/b39e3c2b1baefc011825f8e443769c2095beeb12))
|
|
231
|
-
* **@formatjs/intl-getcanonicallocales:** fix region casing ([396dbe7](https://github.com/formatjs/formatjs/commit/396dbe769bef6eb82ae274ba4935e70e076b2854))
|
|
232
|
-
* **@formatjs/intl-getcanonicallocales:** Handle aliases properly ([9e19e4b](https://github.com/formatjs/formatjs/commit/9e19e4b769560f3717f9589ab6180e932aaf96f8))
|
|
233
|
-
* **@formatjs/intl-getcanonicallocales:** set the polyfill if native impl is buggy ([555a28b](https://github.com/formatjs/formatjs/commit/555a28b2d6d3c48f69d765c5090f7880ef603adc))
|
|
234
|
-
* **@formatjs/intl-locale:** fix add/remove likely subtags ([d72f952](https://github.com/formatjs/formatjs/commit/d72f952a66905a3a7edd75518ccaa72c2020273e))
|
|
235
|
-
|
|
236
|
-
## [1.2.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.2.0...@formatjs/intl-getcanonicallocales@1.2.1) (2020-05-23)
|
|
237
|
-
|
|
238
|
-
**Note:** Version bump only for package @formatjs/intl-getcanonicallocales
|
|
239
|
-
|
|
240
|
-
# [1.2.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.1.1...@formatjs/intl-getcanonicallocales@1.2.0) (2020-05-23)
|
|
241
|
-
|
|
242
|
-
### Bug Fixes
|
|
243
|
-
|
|
244
|
-
* **@formatjs/intl-getcanonicallocales:** fix type def path in ([5df9a0b](https://github.com/formatjs/formatjs/commit/5df9a0b21e6b932835967c1d90a8cacab3d86892))
|
|
245
|
-
|
|
246
|
-
### Features
|
|
247
|
-
|
|
248
|
-
* **@formatjs/intl-getcanonicallocales:** Expose more functions to ([6fd12ec](https://github.com/formatjs/formatjs/commit/6fd12ec23b9857a92365584497d462cbac2b81f4))
|
|
249
|
-
|
|
250
|
-
## [1.1.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-getcanonicallocales@1.1.0...@formatjs/intl-getcanonicallocales@1.1.1) (2020-05-22)
|
|
251
|
-
|
|
252
|
-
### Bug Fixes
|
|
253
|
-
|
|
254
|
-
* **eslint-plugin-formatjs:** add no-id to index ([8e5c0af](https://github.com/formatjs/formatjs/commit/8e5c0afe69944d52653b92c2f08e15363246834a))
|
|
255
|
-
|
|
256
|
-
# 1.1.0 (2020-05-22)
|
|
257
|
-
|
|
258
|
-
### Features
|
|
259
|
-
|
|
260
|
-
* **@formatjs/intl-getcanonicallocales:** initial commit ([daba5a4](https://github.com/formatjs/formatjs/commit/daba5a4944bbab29573d02f626606262a035901d))
|
|
261
|
-
|
|
262
|
-
## [1.1.1](https://github.com/formatjs/formatjs/compare/@formatjs/intl-locale@1.1.0...@formatjs/intl-locale@1.1.1) (2020-05-21)
|
|
263
|
-
|
|
264
|
-
**Note:** Version bump only for package @formatjs/intl-locale
|
|
265
|
-
|
|
266
|
-
# [1.1.0](https://github.com/formatjs/formatjs/compare/@formatjs/intl-locale@0.1.0...@formatjs/intl-locale@1.1.0) (2020-05-20)
|
|
267
|
-
|
|
268
|
-
### Bug Fixes
|
|
269
|
-
|
|
270
|
-
* **@formatjs/intl-locale:** fix according to https://github.com/tc39/test262/issues/2628 ([1006ed2](https://github.com/formatjs/formatjs/commit/1006ed248837930ffb951d8936feec9878231c71))
|
|
271
|
-
* **@formatjs/intl-locale:** fix and docs ([5c5ef76](https://github.com/formatjs/formatjs/commit/5c5ef7657dd939bc08a9233f25cbae7a662c439f))
|
|
272
|
-
* **@formatjs/intl-locale:** fix minimize ([5ee8909](https://github.com/formatjs/formatjs/commit/5ee890910bd7260e0d549a2dd89f8e39dcbdfc60))
|
|
273
|
-
* **@formatjs/intl-locale:** fix minimize ([2c21dcb](https://github.com/formatjs/formatjs/commit/2c21dcb97043902c5ce7de643b20138333125693))
|
|
274
|
-
* **@formatjs/intl-locale:** more fixes ([1bbd03d](https://github.com/formatjs/formatjs/commit/1bbd03d46905e869c3f69e79c647b64d20d3403f))
|
|
275
|
-
* **@formatjs/intl-locale:** split out likelySubtags data ([ed34904](https://github.com/formatjs/formatjs/commit/ed3490496dc793ebbad6446d1d304d2cb2e23fd1))
|
|
276
|
-
|
|
277
|
-
### Features
|
|
278
|
-
|
|
279
|
-
* **@formatjs/intl-locale:** make it public ([c377a28](https://github.com/formatjs/formatjs/commit/c377a2899b74800422221453ecd7d7f477810995))
|
|
280
|
-
* **@formatjs/intl-locale:** Use a much smaller handwritten parser ([c210cbf](https://github.com/formatjs/formatjs/commit/c210cbff1b88245a3e041b14edaaf2f5aefca3bd))
|
|
281
|
-
|
|
282
|
-
# 0.1.0 (2020-05-18)
|
|
283
|
-
|
|
284
|
-
### Bug Fixes
|
|
285
|
-
|
|
286
|
-
* **react-intl:** reduce onError chattiness ([42d0ac4](https://github.com/formatjs/formatjs/commit/42d0ac433d4d31629bd2aadb2dafb49775d01aac))
|
|
287
|
-
|
|
288
|
-
### Features
|
|
289
|
-
|
|
290
|
-
* **@formatjs/intl-locale:** initial commit ([f469e81](https://github.com/formatjs/formatjs/commit/f469e812a052318c8ec0816abc86035256e4fe11))
|
package/index.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import {parseUnicodeLocaleId} from './src/parser'
|
|
2
|
-
import {emitUnicodeLocaleId} from './src/emitter'
|
|
3
|
-
import {canonicalizeUnicodeLocaleId} from './src/canonicalizer'
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* https://tc39.es/ecma402/#sec-canonicalizelocalelist
|
|
7
|
-
* @param locales
|
|
8
|
-
*/
|
|
9
|
-
function CanonicalizeLocaleList(locales?: string[] | string): string[] {
|
|
10
|
-
if (locales === undefined) {
|
|
11
|
-
return []
|
|
12
|
-
}
|
|
13
|
-
const seen: string[] = []
|
|
14
|
-
if (typeof locales === 'string') {
|
|
15
|
-
locales = [locales]
|
|
16
|
-
}
|
|
17
|
-
for (const locale of locales) {
|
|
18
|
-
const canonicalizedTag = emitUnicodeLocaleId(
|
|
19
|
-
canonicalizeUnicodeLocaleId(parseUnicodeLocaleId(locale))
|
|
20
|
-
)
|
|
21
|
-
if (seen.indexOf(canonicalizedTag) < 0) {
|
|
22
|
-
seen.push(canonicalizedTag)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return seen
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export function getCanonicalLocales(locales?: string[] | string): string[] {
|
|
29
|
-
return CanonicalizeLocaleList(locales)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
parseUnicodeLocaleId,
|
|
34
|
-
parseUnicodeLanguageId,
|
|
35
|
-
isStructurallyValidLanguageTag,
|
|
36
|
-
isUnicodeRegionSubtag,
|
|
37
|
-
isUnicodeScriptSubtag,
|
|
38
|
-
isUnicodeLanguageSubtag,
|
|
39
|
-
} from './src/parser'
|
|
40
|
-
export * from './src/types'
|
|
41
|
-
export * from './src/emitter'
|
|
42
|
-
|
|
43
|
-
export * from './src/likelySubtags.generated'
|
package/polyfill.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import {getCanonicalLocales} from './'
|
|
2
|
-
import {shouldPolyfill} from './should-polyfill'
|
|
3
|
-
if (typeof Intl === 'undefined') {
|
|
4
|
-
if (typeof window !== 'undefined') {
|
|
5
|
-
Object.defineProperty(window, 'Intl', {
|
|
6
|
-
value: {},
|
|
7
|
-
})
|
|
8
|
-
// @ts-ignore we don't include @types/node so global isn't a thing
|
|
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
|
-
if (shouldPolyfill()) {
|
|
17
|
-
Object.defineProperty(Intl, 'getCanonicalLocales', {
|
|
18
|
-
value: getCanonicalLocales,
|
|
19
|
-
writable: true,
|
|
20
|
-
enumerable: false,
|
|
21
|
-
configurable: true,
|
|
22
|
-
})
|
|
23
|
-
}
|
package/scripts/aliases.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import {outputFileSync} from 'fs-extra'
|
|
2
|
-
import * as aliases from 'cldr-core/supplemental/aliases.json'
|
|
3
|
-
import minimist from 'minimist'
|
|
4
|
-
|
|
5
|
-
const {languageAlias, territoryAlias, scriptAlias, variantAlias} =
|
|
6
|
-
aliases.supplemental.metadata.alias
|
|
7
|
-
|
|
8
|
-
function main({out}: minimist.ParsedArgs) {
|
|
9
|
-
const data = {
|
|
10
|
-
languageAlias: Object.keys(languageAlias).reduce(
|
|
11
|
-
(all: Record<string, string>, locale) => {
|
|
12
|
-
all[locale] = languageAlias[locale as 'zh-cmn']._replacement
|
|
13
|
-
return all
|
|
14
|
-
},
|
|
15
|
-
{}
|
|
16
|
-
),
|
|
17
|
-
territoryAlias: Object.keys(territoryAlias).reduce(
|
|
18
|
-
(all: Record<string, string>, locale) => {
|
|
19
|
-
all[locale] = territoryAlias[locale as '004']._replacement
|
|
20
|
-
return all
|
|
21
|
-
},
|
|
22
|
-
{}
|
|
23
|
-
),
|
|
24
|
-
scriptAlias: Object.keys(scriptAlias).reduce(
|
|
25
|
-
(all: Record<string, string>, locale) => {
|
|
26
|
-
all[locale] = scriptAlias[locale as 'Qaai']._replacement
|
|
27
|
-
return all
|
|
28
|
-
},
|
|
29
|
-
{}
|
|
30
|
-
),
|
|
31
|
-
variantAlias: Object.keys(variantAlias).reduce(
|
|
32
|
-
(all: Record<string, string>, locale) => {
|
|
33
|
-
all[locale] = variantAlias[locale as 'heploc']._replacement
|
|
34
|
-
return all
|
|
35
|
-
},
|
|
36
|
-
{}
|
|
37
|
-
),
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
outputFileSync(
|
|
41
|
-
out,
|
|
42
|
-
`/* @generated */
|
|
43
|
-
// prettier-ignore
|
|
44
|
-
export const languageAlias: Record<string, string> = ${JSON.stringify(
|
|
45
|
-
data.languageAlias,
|
|
46
|
-
undefined,
|
|
47
|
-
2
|
|
48
|
-
)};
|
|
49
|
-
export const territoryAlias: Record<string, string> = ${JSON.stringify(
|
|
50
|
-
data.territoryAlias,
|
|
51
|
-
undefined,
|
|
52
|
-
2
|
|
53
|
-
)};
|
|
54
|
-
export const scriptAlias: Record<string, string> = ${JSON.stringify(
|
|
55
|
-
data.scriptAlias,
|
|
56
|
-
undefined,
|
|
57
|
-
2
|
|
58
|
-
)};
|
|
59
|
-
export const variantAlias: Record<string, string> = ${JSON.stringify(
|
|
60
|
-
data.variantAlias,
|
|
61
|
-
undefined,
|
|
62
|
-
2
|
|
63
|
-
)};
|
|
64
|
-
`
|
|
65
|
-
)
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (require.main === module) {
|
|
69
|
-
main(minimist(process.argv))
|
|
70
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import {outputFileSync} from 'fs-extra'
|
|
2
|
-
import minimist from 'minimist'
|
|
3
|
-
import * as likelySubtags from 'cldr-core/supplemental/likelySubtags.json'
|
|
4
|
-
function main({out}: minimist.ParsedArgs) {
|
|
5
|
-
outputFileSync(
|
|
6
|
-
out,
|
|
7
|
-
`/* @generated */
|
|
8
|
-
// prettier-ignore
|
|
9
|
-
export const likelySubtags: Record<string, string> = ${JSON.stringify(
|
|
10
|
-
likelySubtags.supplemental.likelySubtags,
|
|
11
|
-
undefined,
|
|
12
|
-
2
|
|
13
|
-
)};
|
|
14
|
-
`
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (require.main === module) {
|
|
19
|
-
main(minimist(process.argv))
|
|
20
|
-
}
|
package/should-polyfill.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export function shouldPolyfill() {
|
|
2
|
-
return (
|
|
3
|
-
typeof Intl === 'undefined' ||
|
|
4
|
-
!('getCanonicalLocales' in Intl) ||
|
|
5
|
-
// Native Intl.getCanonicalLocales is just buggy
|
|
6
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=10682
|
|
7
|
-
((Intl as any).getCanonicalLocales as any)('und-x-private')[0] ===
|
|
8
|
-
'x-private'
|
|
9
|
-
)
|
|
10
|
-
}
|