@phensley/timezone
Advanced tools
Comparing version 1.2.0 to 1.2.1
import { __assign } from "tslib"; | ||
import { rawdata } from './autogen.zonedata'; | ||
import { binarySearch } from '@phensley/cldr-utils'; | ||
var numarray = function (s) { return s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []; }; | ||
var numarray = function (s) { return (s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []); }; | ||
/** | ||
@@ -19,6 +19,7 @@ * Implements the time zone lookup. | ||
this.utcinfo = { zoneid: 'Etc/UTC', abbr: 'UTC', dst: 0, offset: 0 }; | ||
var zoneids = raw.zoneids.split('|') | ||
.map(function (e, i) { return [e, i]; }); | ||
var links = raw.links.split('|') | ||
.map(function (e) { var _a = e.split(':'), k = _a[0], j = _a[1]; return [k, Number(j)]; }); | ||
var zoneids = raw.zoneids.split('|').map(function (e, i) { return [e, i]; }); | ||
var links = raw.links.split('|').map(function (e) { | ||
var _a = e.split(':'), k = _a[0], j = _a[1]; | ||
return [k, Number(j)]; | ||
}); | ||
var addlink = function (src, dst) { | ||
@@ -90,3 +91,6 @@ // index a few supported forms of the time zone id or alias | ||
var _a = isutc ? r.fromUTC(t) : r.fromWall(t), utc = _a[0], res = _a[1]; | ||
return [utc, __assign(__assign({}, res), { zoneid: zoneid })]; | ||
return [ | ||
utc, | ||
__assign(__assign({}, res), { zoneid: zoneid }), | ||
]; | ||
} | ||
@@ -136,3 +140,3 @@ return undefined; | ||
for (var i = 1; i < len; i++) { | ||
untils[i] = untils[i - 1] + (index[untils[i]] * 1000); | ||
untils[i] = untils[i - 1] + index[untils[i]] * 1000; | ||
} | ||
@@ -215,3 +219,3 @@ } | ||
dst: Number(_dst), | ||
offset: parseInt(_offset, 36) * 1000 | ||
offset: parseInt(_offset, 36) * 1000, | ||
}; | ||
@@ -221,4 +225,3 @@ }; | ||
}()); | ||
var TYPES = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('') | ||
.reduce(function (p, c, i) { | ||
var TYPES = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').reduce(function (p, c, i) { | ||
p[c] = i; | ||
@@ -225,0 +228,0 @@ return p; |
@@ -6,3 +6,3 @@ "use strict"; | ||
var cldr_utils_1 = require("@phensley/cldr-utils"); | ||
var numarray = function (s) { return s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []; }; | ||
var numarray = function (s) { return (s ? s.split(' ').map(function (n) { return parseInt(n, 36); }) : []); }; | ||
/** | ||
@@ -22,6 +22,7 @@ * Implements the time zone lookup. | ||
this.utcinfo = { zoneid: 'Etc/UTC', abbr: 'UTC', dst: 0, offset: 0 }; | ||
var zoneids = raw.zoneids.split('|') | ||
.map(function (e, i) { return [e, i]; }); | ||
var links = raw.links.split('|') | ||
.map(function (e) { var _a = e.split(':'), k = _a[0], j = _a[1]; return [k, Number(j)]; }); | ||
var zoneids = raw.zoneids.split('|').map(function (e, i) { return [e, i]; }); | ||
var links = raw.links.split('|').map(function (e) { | ||
var _a = e.split(':'), k = _a[0], j = _a[1]; | ||
return [k, Number(j)]; | ||
}); | ||
var addlink = function (src, dst) { | ||
@@ -93,3 +94,6 @@ // index a few supported forms of the time zone id or alias | ||
var _a = isutc ? r.fromUTC(t) : r.fromWall(t), utc = _a[0], res = _a[1]; | ||
return [utc, tslib_1.__assign(tslib_1.__assign({}, res), { zoneid: zoneid })]; | ||
return [ | ||
utc, | ||
tslib_1.__assign(tslib_1.__assign({}, res), { zoneid: zoneid }), | ||
]; | ||
} | ||
@@ -139,3 +143,3 @@ return undefined; | ||
for (var i = 1; i < len; i++) { | ||
untils[i] = untils[i - 1] + (index[untils[i]] * 1000); | ||
untils[i] = untils[i - 1] + index[untils[i]] * 1000; | ||
} | ||
@@ -218,3 +222,3 @@ } | ||
dst: Number(_dst), | ||
offset: parseInt(_offset, 36) * 1000 | ||
offset: parseInt(_offset, 36) * 1000, | ||
}; | ||
@@ -224,4 +228,3 @@ }; | ||
}()); | ||
var TYPES = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('') | ||
.reduce(function (p, c, i) { | ||
var TYPES = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('').reduce(function (p, c, i) { | ||
p[c] = i; | ||
@@ -228,0 +231,0 @@ return p; |
{ | ||
"name": "@phensley/timezone", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Compact timezone lib based on tz database", | ||
@@ -40,13 +40,13 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@phensley/cldr-utils": "^1.2.0", | ||
"tslib": "^1.11.1" | ||
"@phensley/cldr-utils": "^1.2.1", | ||
"tslib": "^1.13.0" | ||
}, | ||
"devDependencies": { | ||
"@microsoft/api-extractor": "^7.7.13", | ||
"@microsoft/api-extractor": "^7.8.0", | ||
"@types/jest": "^25.2.1", | ||
"@types/node": "^13.13.4", | ||
"@types/node": "^14.0.1", | ||
"@types/rimraf": "^3.0.0", | ||
"@types/yargs": "^15.0.4", | ||
"@typescript-eslint/eslint-plugin": "^2.30.0", | ||
"@typescript-eslint/parser": "^2.30.0", | ||
"@typescript-eslint/eslint-plugin": "^2.33.0", | ||
"@typescript-eslint/parser": "^2.33.0", | ||
"beautify-benchmark": "^0.2.4", | ||
@@ -56,11 +56,11 @@ "benchmark": "^2.1.4", | ||
"dts-bundle-generator": "^4.3.0", | ||
"eslint": "^6.8.0", | ||
"eslint": "^7.0.0", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-plugin-prettier": "^3.1.3", | ||
"jest": "^25.4.0", | ||
"jest": "^26.0.1", | ||
"prettier": "^2.0.5", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "^25.4.0", | ||
"ts-node": "^8.9.1", | ||
"typescript": "^3.8.3", | ||
"ts-jest": "^25.5.1", | ||
"ts-node": "^8.10.1", | ||
"typescript": "~3.8.3", | ||
"uglify-es": "^3.3.9", | ||
@@ -86,3 +86,3 @@ "yargs": "^15.3.1" | ||
}, | ||
"gitHead": "42b88fa1fa672c12a88dfe4fea152d1eb614e919" | ||
"gitHead": "b4e3308079a0bcb58a666cd94c248ffd452b2486" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
342284
2058
Updated@phensley/cldr-utils@^1.2.1
Updatedtslib@^1.13.0