@js-joda/timezone 2.3.0 → 2.7.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js-joda/timezone",
3
- "version": "2.3.0",
3
+ "version": "2.7.0",
4
4
  "description": "iana tzdb timezone bindings for js-joda",
5
5
  "typings": "dist/js-joda-timezone.d.ts",
6
6
  "main": "dist/js-joda-timezone.js",
@@ -12,15 +12,16 @@
12
12
  "README.md"
13
13
  ],
14
14
  "scripts": {
15
- "test": "./node_modules/.bin/mocha --timeout 5000 --require @babel/register ./test/*Test.js ./test/**/*Test.js",
16
- "test-coverage": "NODE_ENV=test COVERAGE=1 ../../node_modules/.bin/nyc --report-dir=build/coverage --reporter=lcov --reporter html ./node_modules/.bin/mocha --timeout 5000 --require @babel/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js",
17
- "test-browser": "./node_modules/.bin/karma start --reporters=dots --single-run",
15
+ "version": "npm run build-dist",
16
+ "test": "npx mocha --timeout 5000 --require @babel/register ./test/*Test.js ./test/**/*Test.js",
17
+ "test-coverage": "NODE_ENV=test COVERAGE=1 npx nyc --report-dir=build/coverage --reporter=lcov --reporter html npx mocha --timeout 5000 --require @babel/register --reporter progress ./test/*Test.js ./test/**/*Test.js ./test/**/**/*Test.js",
18
+ "test-browser": "npx karma start --reporters=dots --single-run",
18
19
  "test-ts-definitions": "tsc --noImplicitAny --noEmit --pretty test/typescript_definitions/js-joda-timezone-tests.ts",
19
- "test-saucelabs": "./node_modules/.bin/karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true",
20
+ "test-saucelabs": "npx karma start --reporters=\"dots,saucelabs\" --browsers=\"sl_chrome,sl_ie,sl_firefox\" --single-run=true",
20
21
  "test-ci": "npm run build-dist && npm run test && npm run test-browser && npm run test-ts-definitions && npm run test-coverage",
21
- "build-dist": "./node_modules/.bin/webpack --progress --colors --bail",
22
+ "build-dist": "npx webpack --progress --colors --bail",
22
23
  "transform-data": "node ./transform-data.js",
23
- "lint": "../../node_modules/.bin/eslint ."
24
+ "lint": "npx eslint ."
24
25
  },
25
26
  "repository": {
26
27
  "type": "git",
@@ -44,39 +45,12 @@
44
45
  "@js-joda/core": ">=1.11.0"
45
46
  },
46
47
  "devDependencies": {
47
- "@babel/cli": "^7.7.4",
48
- "@babel/core": "^7.7.4",
49
- "@babel/preset-env": "^7.7.4",
50
- "@babel/register": "^7.7.4",
51
- "@js-joda/core": ">=1.11.0",
52
- "babel-loader": "^8.0.6",
53
- "babel-plugin-istanbul": "^5.2.0",
54
- "chai": "^4.2.0",
55
- "copy-webpack-plugin": "^5.0.5",
56
- "coveralls": "^3.0.8",
57
- "eslint": "^6.7.0",
58
- "json-loader": "^0.5.7",
59
- "karma": "^4.4.1",
60
- "karma-chai-plugins": "^0.9.0",
61
- "karma-chrome-launcher": "^3.1.0",
62
- "karma-firefox-launcher": "^1.2.0",
63
- "karma-mocha": "^1.3.0",
64
- "karma-phantomjs-launcher": "^1.0.4",
65
- "karma-sauce-launcher": "^2.0.2",
66
- "karma-sourcemap-loader": "^0.3.7",
67
- "karma-webpack": "^4.0.2",
68
- "mocha": "^6.2.2",
69
- "moment-timezone": "^0.5.27",
70
- "phantomjs-prebuilt": "^2.1.16",
71
- "typescript": "^3.7.2",
72
- "uglifyjs-webpack-plugin": "^2.2.0",
73
- "webpack": "^4.41.2",
74
- "webpack-cli": "^3.3.10"
48
+ "@js-joda/core": "^4.2.0"
75
49
  },
76
50
  "license": "BSD-3-Clause",
77
51
  "bugs": {
78
52
  "url": "https://github.com/js-joda/js-joda-timezone/issues"
79
53
  },
80
54
  "homepage": "https://github.com/js-joda/js-joda-timezone#readme",
81
- "dependencies": {}
55
+ "gitHead": "cf3ac61c80c0e1f4cc6092022858ce04884ab41a"
82
56
  }
@@ -461,5 +461,5 @@ function binarySearch(array, value) {
461
461
  }
462
462
 
463
463
  function notSupported(msg){
464
- throw new Error('not supported: ' + msg);
464
+ throw new Error(`not supported: ${msg}`);
465
465
  }
@@ -34,7 +34,7 @@ export class MomentZoneRulesProvider extends ZoneRulesProvider {
34
34
  static getRules(zoneId){
35
35
  const tzdbZoneInfo = zones[links[zoneId]];
36
36
  if(tzdbZoneInfo == null){
37
- throw new DateTimeException('Unknown time-zone ID: ' + zoneId);
37
+ throw new DateTimeException(`Unknown time-zone ID: ${zoneId}`);
38
38
  }
39
39
  return new MomentZoneRules(tzdbZoneInfo);
40
40
  }
package/src/auto-plug.js CHANGED
@@ -7,6 +7,9 @@ import { use } from '@js-joda/core';
7
7
 
8
8
  import plug from './plug';
9
9
 
10
+ /**
11
+ * @private
12
+ */
10
13
  export default function autoPlug() {
11
14
  use(plug);
12
15
  }
package/src/plug.js CHANGED
@@ -6,6 +6,9 @@
6
6
  import { MomentZoneRulesProvider } from './MomentZoneRulesProvider';
7
7
  import extendSystemDefaultZoneId from './system-default-zone';
8
8
 
9
+ /**
10
+ * @private
11
+ */
9
12
  export default function (jsJoda) {
10
13
  jsJoda.ZoneRulesProvider.getRules = MomentZoneRulesProvider.getRules;
11
14
  jsJoda.ZoneRulesProvider.getAvailableZoneIds = MomentZoneRulesProvider.getAvailableZoneIds;
@@ -1,4 +1,9 @@
1
-
1
+ /**
2
+ * @private
3
+ *
4
+ * @param ZoneId
5
+ * @returns {null|*}
6
+ */
2
7
  function getResolvedZoneId(ZoneId) {
3
8
  try {
4
9
  const resolvedTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
@@ -9,6 +14,11 @@ function getResolvedZoneId(ZoneId) {
9
14
  return null;
10
15
  }
11
16
 
17
+ /**
18
+ * @private
19
+ *
20
+ * @param ZoneId
21
+ */
12
22
  export default function extendSystemDefaultZoneId(ZoneId) {
13
23
  const resolvedZoneId = getResolvedZoneId(ZoneId);
14
24
 
@@ -19,4 +29,4 @@ export default function extendSystemDefaultZoneId(ZoneId) {
19
29
  ZoneId.systemDefault = function () {
20
30
  return resolvedZoneId;
21
31
  };
22
- }
32
+ }
package/src/unpack.js CHANGED
@@ -10,6 +10,12 @@
10
10
  Unpacking
11
11
  ************************************/
12
12
 
13
+ /**
14
+ * @private
15
+ *
16
+ * @param charCode
17
+ * @returns {number}
18
+ */
13
19
  function charCodeToInt(charCode) {
14
20
  if (charCode > 96) {
15
21
  return charCode - 87;
@@ -75,6 +81,12 @@ function mapIndices (source, indices) {
75
81
  return out;
76
82
  }
77
83
 
84
+ /**
85
+ * @private
86
+ *
87
+ * @param string
88
+ * @returns {{offsets: *[], abbrs: *[], name, untils: *, population: number}}
89
+ */
78
90
  export function unpack (string) {
79
91
  var data = string.split('|'),
80
92
  offsets = data[2].split(' '),