@formatjs/ecma402-abstract 1.18.0 → 1.18.2
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/CanonicalizeTimeZoneName.d.ts +2 -2
- package/CanonicalizeTimeZoneName.js +2 -2
- package/IsValidTimeZoneName.d.ts +2 -2
- package/IsValidTimeZoneName.js +2 -4
- package/lib/CanonicalizeTimeZoneName.d.ts +2 -2
- package/lib/CanonicalizeTimeZoneName.js +2 -2
- package/lib/IsValidTimeZoneName.d.ts +2 -2
- package/lib/IsValidTimeZoneName.js +2 -4
- package/package.json +2 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
|
|
3
3
|
* @param tz
|
|
4
4
|
*/
|
|
5
|
-
export declare function CanonicalizeTimeZoneName(tz: string, {
|
|
6
|
-
|
|
5
|
+
export declare function CanonicalizeTimeZoneName(tz: string, { zoneNames, uppercaseLinks, }: {
|
|
6
|
+
zoneNames: readonly string[];
|
|
7
7
|
uppercaseLinks: Record<string, string>;
|
|
8
8
|
}): string;
|
|
@@ -6,9 +6,9 @@ exports.CanonicalizeTimeZoneName = void 0;
|
|
|
6
6
|
* @param tz
|
|
7
7
|
*/
|
|
8
8
|
function CanonicalizeTimeZoneName(tz, _a) {
|
|
9
|
-
var
|
|
9
|
+
var zoneNames = _a.zoneNames, uppercaseLinks = _a.uppercaseLinks;
|
|
10
10
|
var uppercasedTz = tz.toUpperCase();
|
|
11
|
-
var uppercasedZones =
|
|
11
|
+
var uppercasedZones = zoneNames.reduce(function (all, z) {
|
|
12
12
|
all[z.toUpperCase()] = z;
|
|
13
13
|
return all;
|
|
14
14
|
}, {});
|
package/IsValidTimeZoneName.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param tz
|
|
4
4
|
* @param implDetails implementation details
|
|
5
5
|
*/
|
|
6
|
-
export declare function IsValidTimeZoneName(tz: string, {
|
|
7
|
-
|
|
6
|
+
export declare function IsValidTimeZoneName(tz: string, { zoneNamesFromData, uppercaseLinks, }: {
|
|
7
|
+
zoneNamesFromData: readonly string[];
|
|
8
8
|
uppercaseLinks: Record<string, string>;
|
|
9
9
|
}): boolean;
|
package/IsValidTimeZoneName.js
CHANGED
|
@@ -7,13 +7,11 @@ exports.IsValidTimeZoneName = void 0;
|
|
|
7
7
|
* @param implDetails implementation details
|
|
8
8
|
*/
|
|
9
9
|
function IsValidTimeZoneName(tz, _a) {
|
|
10
|
-
var
|
|
10
|
+
var zoneNamesFromData = _a.zoneNamesFromData, uppercaseLinks = _a.uppercaseLinks;
|
|
11
11
|
var uppercasedTz = tz.toUpperCase();
|
|
12
12
|
var zoneNames = new Set();
|
|
13
13
|
var linkNames = new Set();
|
|
14
|
-
|
|
15
|
-
.map(function (z) { return z.toUpperCase(); })
|
|
16
|
-
.forEach(function (z) { return zoneNames.add(z); });
|
|
14
|
+
zoneNamesFromData.map(function (z) { return z.toUpperCase(); }).forEach(function (z) { return zoneNames.add(z); });
|
|
17
15
|
Object.keys(uppercaseLinks).forEach(function (linkName) {
|
|
18
16
|
linkNames.add(linkName.toUpperCase());
|
|
19
17
|
zoneNames.add(uppercaseLinks[linkName].toUpperCase());
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* https://tc39.es/ecma402/#sec-canonicalizetimezonename
|
|
3
3
|
* @param tz
|
|
4
4
|
*/
|
|
5
|
-
export declare function CanonicalizeTimeZoneName(tz: string, {
|
|
6
|
-
|
|
5
|
+
export declare function CanonicalizeTimeZoneName(tz: string, { zoneNames, uppercaseLinks, }: {
|
|
6
|
+
zoneNames: readonly string[];
|
|
7
7
|
uppercaseLinks: Record<string, string>;
|
|
8
8
|
}): string;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @param tz
|
|
4
4
|
*/
|
|
5
5
|
export function CanonicalizeTimeZoneName(tz, _a) {
|
|
6
|
-
var
|
|
6
|
+
var zoneNames = _a.zoneNames, uppercaseLinks = _a.uppercaseLinks;
|
|
7
7
|
var uppercasedTz = tz.toUpperCase();
|
|
8
|
-
var uppercasedZones =
|
|
8
|
+
var uppercasedZones = zoneNames.reduce(function (all, z) {
|
|
9
9
|
all[z.toUpperCase()] = z;
|
|
10
10
|
return all;
|
|
11
11
|
}, {});
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @param tz
|
|
4
4
|
* @param implDetails implementation details
|
|
5
5
|
*/
|
|
6
|
-
export declare function IsValidTimeZoneName(tz: string, {
|
|
7
|
-
|
|
6
|
+
export declare function IsValidTimeZoneName(tz: string, { zoneNamesFromData, uppercaseLinks, }: {
|
|
7
|
+
zoneNamesFromData: readonly string[];
|
|
8
8
|
uppercaseLinks: Record<string, string>;
|
|
9
9
|
}): boolean;
|
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
* @param implDetails implementation details
|
|
5
5
|
*/
|
|
6
6
|
export function IsValidTimeZoneName(tz, _a) {
|
|
7
|
-
var
|
|
7
|
+
var zoneNamesFromData = _a.zoneNamesFromData, uppercaseLinks = _a.uppercaseLinks;
|
|
8
8
|
var uppercasedTz = tz.toUpperCase();
|
|
9
9
|
var zoneNames = new Set();
|
|
10
10
|
var linkNames = new Set();
|
|
11
|
-
|
|
12
|
-
.map(function (z) { return z.toUpperCase(); })
|
|
13
|
-
.forEach(function (z) { return zoneNames.add(z); });
|
|
11
|
+
zoneNamesFromData.map(function (z) { return z.toUpperCase(); }).forEach(function (z) { return zoneNames.add(z); });
|
|
14
12
|
Object.keys(uppercaseLinks).forEach(function (linkName) {
|
|
15
13
|
linkNames.add(linkName.toUpperCase());
|
|
16
14
|
zoneNames.add(uppercaseLinks[linkName].toUpperCase());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/ecma402-abstract",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "A collection of implementation for ECMAScript abstract operations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"intl",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "^2.4.0",
|
|
18
|
-
"@formatjs/intl-localematcher": "0.5.
|
|
18
|
+
"@formatjs/intl-localematcher": "0.5.4"
|
|
19
19
|
},
|
|
20
20
|
"author": "Long Ho <holevietlong@gmail.com",
|
|
21
21
|
"bugs": {
|