@formatjs/intl-displaynames 1.2.6 → 1.2.10

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/CHANGELOG.md CHANGED
@@ -3,6 +3,38 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.2.10](https://github.com/formatjs/formatjs/compare/@formatjs/intl-displaynames@1.2.9...@formatjs/intl-displaynames@1.2.10) (2020-05-16)
7
+
8
+ **Note:** Version bump only for package @formatjs/intl-displaynames
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.2.9](https://github.com/formatjs/formatjs/compare/@formatjs/intl-displaynames@1.2.8...@formatjs/intl-displaynames@1.2.9) (2020-05-05)
15
+
16
+ **Note:** Version bump only for package @formatjs/intl-displaynames
17
+
18
+
19
+
20
+
21
+
22
+ ## 1.2.8 (2020-04-28)
23
+
24
+ **Note:** Version bump only for package @formatjs/intl-displaynames
25
+
26
+
27
+
28
+
29
+
30
+ ## [1.2.7](https://github.com/formatjs/formatjs/compare/@formatjs/intl-displaynames@1.2.6...@formatjs/intl-displaynames@1.2.7) (2020-04-25)
31
+
32
+ **Note:** Version bump only for package @formatjs/intl-displaynames
33
+
34
+
35
+
36
+
37
+
6
38
  ## [1.2.6](https://github.com/formatjs/formatjs/compare/@formatjs/intl-displaynames@1.2.5...@formatjs/intl-displaynames@1.2.6) (2020-04-24)
7
39
 
8
40
 
package/README.md CHANGED
@@ -1,44 +1,3 @@
1
1
  # `intl-displaynames`
2
2
 
3
- A ponyfill/polyfill for [`intl-displaynames`](https://tc39.es/proposal-intl-displaynames).
4
-
5
- ## Status
6
-
7
- `intl-displaynames` is beta quality software that hasn't been tested thoroughly.
8
-
9
- ## Installation
10
-
11
- ```
12
- npm install @formatjs/intl-displaynames
13
- ```
14
-
15
- # Features
16
-
17
- Everything in <https://github.com/tc39/proposal-intl-displaynames>.
18
-
19
- # Usage
20
-
21
- To use the ponyfill, import it along with its data:
22
-
23
- ```ts
24
- import {DisplayNames} from '@formatjs/intl-displaynames';
25
- DisplayNames.__addLocaleData(
26
- require('@formatjs/intl-displaynames/dist/locale-data/en.json') // locale-data for en
27
- );
28
- DisplayNames.__addLocaleData(
29
- require('@formatjs/intl-displaynames/dist/locale-data/zh.json') // locale-data for zh
30
- );
31
-
32
- new DisplayNames('zh', {type: 'currency'}).of('USD'); //=> "美元"
33
- ```
34
-
35
- To use this as a polyfill, override `Intl.DisplayNames` as below:
36
-
37
- ```javascript
38
- import '@formatjs/intl-displaynames/polyfill';
39
- import '@formatjs/intl-displaynames/dist/locale-data/en'; // locale-data for en
40
- import '@formatjs/intl-displaynames/dist/locale-data/zh'; // locale-data for zh
41
-
42
- new Intl.DisplayNames('en').of('zh-Hans'); //=> "Simplified Chinese"
43
- new Intl.DisplayNames('zh', {type: 'currency'}).of('USD'); //=> "美元"
44
- ```
3
+ We've migrated the docs to https://formatjs.io.
@@ -113,7 +113,8 @@
113
113
  // NOTE: we must NOT call `supportedLocalesOf` of a formatjs polyfill, or their implementation
114
114
  // will even eventually call this method recursively. Here we use `Intl.DateTimeFormat` since it
115
115
  // is not polyfilled by `@formatjs`.
116
- return Intl.DateTimeFormat.supportedLocalesOf(locales || '');
116
+ // TODO: Fix TypeScript type def for this bc undefined is just fine
117
+ return Intl.DateTimeFormat.supportedLocalesOf(locales);
117
118
  }
118
119
 
119
120
  function createResolveLocale(getDefaultLocale) {