Skip to content

Commit 4857386

Browse files
committed
Address PR comments
1 parent e0e1bde commit 4857386

File tree

10 files changed

+75
-74
lines changed

10 files changed

+75
-74
lines changed

src/lib/es2022.intl.d.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,4 @@ declare namespace Intl {
8888
*/
8989
supportedLocalesOf(locales: BCP47LanguageTag | BCP47LanguageTag[], options?: Pick<SegmenterOptions, "localeMatcher">): BCP47LanguageTag[];
9090
};
91-
92-
type EnumerationKeys = "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit";
93-
94-
/**
95-
* Returns a list of the supported collation, calendar, currency, numbering system, timezones, and units by the implementation.
96-
*
97-
* @param key A string indicating the category of values to return.
98-
*
99-
* @returns {string[]} A list of the supported values.
100-
*
101-
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf)
102-
*/
103-
function supportedValuesOf(key: EnumerationKeys): string[];
10491
}

src/lib/esnext.intl.d.ts

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
declare namespace Intl {
2-
interface NumberRangeFormatPart extends NumberFormatPart {
3-
source: "startRange" | "endRange" | "shared"
4-
}
2+
interface NumberRangeFormatPart extends NumberFormatPart {
3+
source: "startRange" | "endRange" | "shared"
4+
}
55

6-
interface NumberFormat {
7-
formatRange(start: number | bigint, end: number | bigint): string;
8-
formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
9-
}
6+
interface NumberFormat {
7+
formatRange(start: number | bigint, end: number | bigint): string;
8+
formatRangeToParts(start: number | bigint, end: number | bigint): NumberRangeFormatPart[];
9+
}
10+
11+
/**
12+
* Returns a sorted array of the supported collation, calendar, currency, numbering system, timezones, and units by the implementation.
13+
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf)
14+
*
15+
* @param key A string indicating the category of values to return.
16+
* @returns A sorted array of the supported values.
17+
*/
18+
function supportedValuesOf(key: "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"): string[];
1019
}

tests/baselines/reference/es2022IntlAPIs.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ for (const zoneName of timezoneNames) {
77
timeZoneName: zoneName,
88
});
99
}
10-
11-
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
12-
for (const key of enumerationKeys) {
13-
var supported = Intl.supportedValuesOf(key);
14-
}
1510

1611

1712
//// [es2022IntlAPIs.js]
@@ -23,7 +18,3 @@ for (const zoneName of timezoneNames) {
2318
timeZoneName: zoneName,
2419
});
2520
}
26-
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'];
27-
for (const key of enumerationKeys) {
28-
var supported = Intl.supportedValuesOf(key);
29-
}

tests/baselines/reference/es2022IntlAPIs.symbols

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,3 @@ for (const zoneName of timezoneNames) {
2424
});
2525
}
2626

27-
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
28-
>enumerationKeys : Symbol(enumerationKeys, Decl(es2022IntlAPIs.ts, 9, 5))
29-
>const : Symbol(const)
30-
31-
for (const key of enumerationKeys) {
32-
>key : Symbol(key, Decl(es2022IntlAPIs.ts, 10, 10))
33-
>enumerationKeys : Symbol(enumerationKeys, Decl(es2022IntlAPIs.ts, 9, 5))
34-
35-
var supported = Intl.supportedValuesOf(key);
36-
>supported : Symbol(supported, Decl(es2022IntlAPIs.ts, 11, 5))
37-
>Intl.supportedValuesOf : Symbol(Intl.supportedValuesOf, Decl(lib.es2022.intl.d.ts, --, --))
38-
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --) ... and 3 more)
39-
>supportedValuesOf : Symbol(Intl.supportedValuesOf, Decl(lib.es2022.intl.d.ts, --, --))
40-
>key : Symbol(key, Decl(es2022IntlAPIs.ts, 10, 10))
41-
}
42-

tests/baselines/reference/es2022IntlAPIs.types

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -35,27 +35,3 @@ for (const zoneName of timezoneNames) {
3535
});
3636
}
3737

38-
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
39-
>enumerationKeys : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
40-
>['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
41-
>['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
42-
>'calendar' : "calendar"
43-
>'collation' : "collation"
44-
>'currency' : "currency"
45-
>'numberingSystem' : "numberingSystem"
46-
>'timeZone' : "timeZone"
47-
>'unit' : "unit"
48-
49-
for (const key of enumerationKeys) {
50-
>key : "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"
51-
>enumerationKeys : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
52-
53-
var supported = Intl.supportedValuesOf(key);
54-
>supported : string[]
55-
>Intl.supportedValuesOf(key) : string[]
56-
>Intl.supportedValuesOf : (key: Intl.EnumerationKeys) => string[]
57-
>Intl : typeof Intl
58-
>supportedValuesOf : (key: Intl.EnumerationKeys) => string[]
59-
>key : "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"
60-
}
61-
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//// [esNextIntlAPIs.ts]
2+
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
3+
for (const key of enumerationKeys) {
4+
var supported = Intl.supportedValuesOf(key);
5+
}
6+
7+
8+
//// [esNextIntlAPIs.js]
9+
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'];
10+
for (const key of enumerationKeys) {
11+
var supported = Intl.supportedValuesOf(key);
12+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
=== tests/cases/conformance/esnext/esNextIntlAPIs.ts ===
2+
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
3+
>enumerationKeys : Symbol(enumerationKeys, Decl(esNextIntlAPIs.ts, 0, 5))
4+
>const : Symbol(const)
5+
6+
for (const key of enumerationKeys) {
7+
>key : Symbol(key, Decl(esNextIntlAPIs.ts, 1, 10))
8+
>enumerationKeys : Symbol(enumerationKeys, Decl(esNextIntlAPIs.ts, 0, 5))
9+
10+
var supported = Intl.supportedValuesOf(key);
11+
>supported : Symbol(supported, Decl(esNextIntlAPIs.ts, 2, 5))
12+
>Intl.supportedValuesOf : Symbol(Intl.supportedValuesOf, Decl(lib.esnext.intl.d.ts, --, --))
13+
>Intl : Symbol(Intl, Decl(lib.es5.d.ts, --, --), Decl(lib.es2017.intl.d.ts, --, --), Decl(lib.es2018.intl.d.ts, --, --), Decl(lib.es2019.intl.d.ts, --, --), Decl(lib.es2020.bigint.d.ts, --, --) ... and 4 more)
14+
>supportedValuesOf : Symbol(Intl.supportedValuesOf, Decl(lib.esnext.intl.d.ts, --, --))
15+
>key : Symbol(key, Decl(esNextIntlAPIs.ts, 1, 10))
16+
}
17+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
=== tests/cases/conformance/esnext/esNextIntlAPIs.ts ===
2+
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
3+
>enumerationKeys : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
4+
>['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
5+
>['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
6+
>'calendar' : "calendar"
7+
>'collation' : "collation"
8+
>'currency' : "currency"
9+
>'numberingSystem' : "numberingSystem"
10+
>'timeZone' : "timeZone"
11+
>'unit' : "unit"
12+
13+
for (const key of enumerationKeys) {
14+
>key : "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"
15+
>enumerationKeys : readonly ["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"]
16+
17+
var supported = Intl.supportedValuesOf(key);
18+
>supported : string[]
19+
>Intl.supportedValuesOf(key) : string[]
20+
>Intl.supportedValuesOf : (key: "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit") => string[]
21+
>Intl : typeof Intl
22+
>supportedValuesOf : (key: "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit") => string[]
23+
>key : "calendar" | "collation" | "currency" | "numberingSystem" | "timeZone" | "unit"
24+
}
25+

tests/cases/conformance/es2022/es2022IntlAPIs.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,3 @@ for (const zoneName of timezoneNames) {
88
timeZoneName: zoneName,
99
});
1010
}
11-
12-
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
13-
for (const key of enumerationKeys) {
14-
var supported = Intl.supportedValuesOf(key);
15-
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// @target: esnext
2+
const enumerationKeys = ['calendar', 'collation', 'currency', 'numberingSystem', 'timeZone', 'unit'] as const;
3+
for (const key of enumerationKeys) {
4+
var supported = Intl.supportedValuesOf(key);
5+
}

0 commit comments

Comments
 (0)