@formatjs/ecma402-abstract 1.9.2 → 1.9.3
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/IsValidTimeZoneName.d.ts
CHANGED
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function IsValidTimeZoneName(tz: string, { tzData, uppercaseLinks, }: {
|
|
7
7
|
tzData: Record<string, unknown>;
|
|
8
|
-
uppercaseLinks: Record<string,
|
|
8
|
+
uppercaseLinks: Record<string, string>;
|
|
9
9
|
}): boolean;
|
|
10
10
|
//# sourceMappingURL=IsValidTimeZoneName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsValidTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/IsValidTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"IsValidTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../packages/ecma402-abstract/IsValidTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC,GACA,OAAO,CAYT"}
|
package/IsValidTimeZoneName.js
CHANGED
|
@@ -10,9 +10,14 @@ function IsValidTimeZoneName(tz, _a) {
|
|
|
10
10
|
var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
|
|
11
11
|
var uppercasedTz = tz.toUpperCase();
|
|
12
12
|
var zoneNames = new Set();
|
|
13
|
+
var linkNames = new Set();
|
|
13
14
|
Object.keys(tzData)
|
|
14
15
|
.map(function (z) { return z.toUpperCase(); })
|
|
15
16
|
.forEach(function (z) { return zoneNames.add(z); });
|
|
16
|
-
|
|
17
|
+
Object.keys(uppercaseLinks).forEach(function (linkName) {
|
|
18
|
+
linkNames.add(linkName.toUpperCase());
|
|
19
|
+
zoneNames.add(uppercaseLinks[linkName].toUpperCase());
|
|
20
|
+
});
|
|
21
|
+
return zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz);
|
|
17
22
|
}
|
|
18
23
|
exports.IsValidTimeZoneName = IsValidTimeZoneName;
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function IsValidTimeZoneName(tz: string, { tzData, uppercaseLinks, }: {
|
|
7
7
|
tzData: Record<string, unknown>;
|
|
8
|
-
uppercaseLinks: Record<string,
|
|
8
|
+
uppercaseLinks: Record<string, string>;
|
|
9
9
|
}): boolean;
|
|
10
10
|
//# sourceMappingURL=IsValidTimeZoneName.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IsValidTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/IsValidTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"IsValidTimeZoneName.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/IsValidTimeZoneName.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,MAAM,EACV,EACE,MAAM,EACN,cAAc,GACf,EAAE;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACvC,GACA,OAAO,CAYT"}
|
|
@@ -7,8 +7,13 @@ export function IsValidTimeZoneName(tz, _a) {
|
|
|
7
7
|
var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
|
|
8
8
|
var uppercasedTz = tz.toUpperCase();
|
|
9
9
|
var zoneNames = new Set();
|
|
10
|
+
var linkNames = new Set();
|
|
10
11
|
Object.keys(tzData)
|
|
11
12
|
.map(function (z) { return z.toUpperCase(); })
|
|
12
13
|
.forEach(function (z) { return zoneNames.add(z); });
|
|
13
|
-
|
|
14
|
+
Object.keys(uppercaseLinks).forEach(function (linkName) {
|
|
15
|
+
linkNames.add(linkName.toUpperCase());
|
|
16
|
+
zoneNames.add(uppercaseLinks[linkName].toUpperCase());
|
|
17
|
+
});
|
|
18
|
+
return zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz);
|
|
14
19
|
}
|