libshv-js 7.0.10 → 7.0.14
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/dist/cpon.js +8 -15
- package/dist/json.js +1 -1
- package/package.json +6 -5
package/dist/cpon.js
CHANGED
|
@@ -233,40 +233,34 @@ class CponReader {
|
|
|
233
233
|
return date;
|
|
234
234
|
}
|
|
235
235
|
readDateTimeInner() {
|
|
236
|
-
let year = 0;
|
|
237
|
-
let month = 0;
|
|
238
|
-
let day = 1;
|
|
239
|
-
let hour = 0;
|
|
240
|
-
let min = 0;
|
|
241
|
-
let sec = 0;
|
|
242
|
-
let msec = 0;
|
|
243
236
|
let utcOffset = 0;
|
|
244
|
-
year = Number(this.readInt());
|
|
237
|
+
const year = Number(this.readInt());
|
|
245
238
|
let b = this.ctx.getByte();
|
|
246
239
|
if (b !== '-'.codePointAt(0)) {
|
|
247
240
|
throw new TypeError('Malformed year-month separator in DateTime');
|
|
248
241
|
}
|
|
249
|
-
month = Number(this.readInt());
|
|
242
|
+
const month = Number(this.readInt());
|
|
250
243
|
b = this.ctx.getByte();
|
|
251
244
|
if (b !== '-'.codePointAt(0)) {
|
|
252
245
|
throw new TypeError('Malformed year-month separator in DateTime');
|
|
253
246
|
}
|
|
254
|
-
day = Number(this.readInt());
|
|
247
|
+
const day = Number(this.readInt());
|
|
255
248
|
b = this.ctx.getByte();
|
|
256
249
|
if (b !== ' '.codePointAt(0) && b !== 'T'.codePointAt(0)) {
|
|
257
250
|
throw new TypeError('Malformed date-time separator in DateTime');
|
|
258
251
|
}
|
|
259
|
-
hour = Number(this.readInt());
|
|
252
|
+
const hour = Number(this.readInt());
|
|
260
253
|
b = this.ctx.getByte();
|
|
261
254
|
if (b !== ':'.codePointAt(0)) {
|
|
262
255
|
throw new TypeError('Malformed year-month separator in DateTime');
|
|
263
256
|
}
|
|
264
|
-
min = Number(this.readInt());
|
|
257
|
+
const min = Number(this.readInt());
|
|
265
258
|
b = this.ctx.getByte();
|
|
266
259
|
if (b !== ':'.codePointAt(0)) {
|
|
267
260
|
throw new TypeError('Malformed year-month separator in DateTime');
|
|
268
261
|
}
|
|
269
|
-
sec = Number(this.readInt());
|
|
262
|
+
const sec = Number(this.readInt());
|
|
263
|
+
let msec = 0;
|
|
270
264
|
b = this.ctx.peekByte();
|
|
271
265
|
if (b === '.'.codePointAt(0)) {
|
|
272
266
|
this.ctx.getByte();
|
|
@@ -491,7 +485,6 @@ class CponReader {
|
|
|
491
485
|
return val;
|
|
492
486
|
}
|
|
493
487
|
readNumber() {
|
|
494
|
-
let mantisa = 0;
|
|
495
488
|
let exponent = 0;
|
|
496
489
|
let decimals = 0;
|
|
497
490
|
let decCnt = 0;
|
|
@@ -507,7 +500,7 @@ class CponReader {
|
|
|
507
500
|
isNeg = true;
|
|
508
501
|
b = this.ctx.getByte();
|
|
509
502
|
}
|
|
510
|
-
mantisa = Number(this.readInt());
|
|
503
|
+
let mantisa = Number(this.readInt());
|
|
511
504
|
b = this.ctx.peekByte();
|
|
512
505
|
(() => {
|
|
513
506
|
while (true) {
|
package/dist/json.js
CHANGED
|
@@ -27,7 +27,7 @@ const decodeValueJson = (x) => {
|
|
|
27
27
|
if (typeof typeValue !== 'object' || typeValue === null) {
|
|
28
28
|
throw new TypeError(`Invalid JSON-encoded IMap: '${JSON.stringify(typeValue)}'`);
|
|
29
29
|
}
|
|
30
|
-
if (Object.keys(typeValue).some(key => !/^-?\d
|
|
30
|
+
if (Object.keys(typeValue).some(key => !/^-?\d+$/v.test(key))) {
|
|
31
31
|
throw new TypeError(`Invalid JSON-encoded IMap (non-Int key): '${JSON.stringify(typeValue)}'`);
|
|
32
32
|
}
|
|
33
33
|
return (0, rpcvalue_1.makeIMap)(decodeMap(typeValue));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libshv-js",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.14",
|
|
4
4
|
"description": "Typescript implementation of libshv",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -37,11 +37,12 @@
|
|
|
37
37
|
"./ws-client": "./dist/ws-client.js"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
41
|
-
"eslint": "^
|
|
42
|
-
"eslint
|
|
40
|
+
"@typescript-eslint/parser": "^8.56.1",
|
|
41
|
+
"@eslint/js": "^10.0.1",
|
|
42
|
+
"eslint": "^10.0.0",
|
|
43
|
+
"eslint-config-xo": "^0.50.0",
|
|
43
44
|
"eslint-formatter-unix": "^9.0.1",
|
|
44
|
-
"eslint-plugin-unicorn": "^
|
|
45
|
+
"eslint-plugin-unicorn": "^63.0.0",
|
|
45
46
|
"typescript": "^5.9.3",
|
|
46
47
|
"typescript-eslint": "^8.46.1"
|
|
47
48
|
}
|