Spaces:
Runtime error
Runtime error
File size: 883 Bytes
b5ea024 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.IsValidTimeZoneName = void 0;
/**
* https://tc39.es/ecma402/#sec-isvalidtimezonename
* @param tz
* @param implDetails implementation details
*/
function IsValidTimeZoneName(tz, _a) {
var tzData = _a.tzData, uppercaseLinks = _a.uppercaseLinks;
var uppercasedTz = tz.toUpperCase();
var zoneNames = new Set();
var linkNames = new Set();
Object.keys(tzData)
.map(function (z) { return z.toUpperCase(); })
.forEach(function (z) { return zoneNames.add(z); });
Object.keys(uppercaseLinks).forEach(function (linkName) {
linkNames.add(linkName.toUpperCase());
zoneNames.add(uppercaseLinks[linkName].toUpperCase());
});
return zoneNames.has(uppercasedTz) || linkNames.has(uppercasedTz);
}
exports.IsValidTimeZoneName = IsValidTimeZoneName;
|