neo4j-driver-core
Advanced tools
Comparing version 5.16.0 to 5.17.0
@@ -378,8 +378,19 @@ "use strict"; | ||
exports.assertValidNanosecond = assertValidNanosecond; | ||
var timeZoneValidityCache = new Map(); | ||
var newInvalidZoneIdError = function (zoneId, fieldName) { return (0, error_1.newError)("".concat(fieldName, " is expected to be a valid ZoneId but was: \"").concat(zoneId, "\"")); }; | ||
function assertValidZoneId(fieldName, zoneId) { | ||
var cachedResult = timeZoneValidityCache.get(zoneId); | ||
if (cachedResult === true) { | ||
return; | ||
} | ||
if (cachedResult === false) { | ||
throw newInvalidZoneIdError(zoneId, fieldName); | ||
} | ||
try { | ||
Intl.DateTimeFormat(undefined, { timeZone: zoneId }); | ||
timeZoneValidityCache.set(zoneId, true); | ||
} | ||
catch (e) { | ||
throw (0, error_1.newError)("".concat(fieldName, " is expected to be a valid ZoneId but was: \"").concat(zoneId, "\"")); | ||
timeZoneValidityCache.set(zoneId, false); | ||
throw newInvalidZoneIdError(zoneId, fieldName); | ||
} | ||
@@ -386,0 +397,0 @@ } |
{ | ||
"name": "neo4j-driver-core", | ||
"version": "5.16.0", | ||
"version": "5.17.0", | ||
"description": "Internals of neo4j-driver", | ||
@@ -48,3 +48,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "532f3eaa7de85d4d762c1b30b4657dbd4d240b1e" | ||
"gitHead": "b7f3e7a5322b8695671baeacc5ef067b761be65c" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
664102
15667