libshv-js 7.1.8 → 7.1.10
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/chainpack.js +3 -4
- package/package.json +3 -3
package/dist/chainpack.js
CHANGED
|
@@ -153,7 +153,7 @@ class ChainPackReader {
|
|
|
153
153
|
return implReturn(new rpcvalue_1.Decimal(mant, exp));
|
|
154
154
|
}
|
|
155
155
|
case PackingSchema.DateTime: {
|
|
156
|
-
let bi = this.readUIntDataHelper('
|
|
156
|
+
let bi = this.readUIntDataHelper('Int');
|
|
157
157
|
const hasTzOffset = bi & 1n;
|
|
158
158
|
const hasNotMsec = bi & 2n;
|
|
159
159
|
bi >>= 2n;
|
|
@@ -175,7 +175,6 @@ class ChainPackReader {
|
|
|
175
175
|
msec *= 1000;
|
|
176
176
|
}
|
|
177
177
|
msec += SHV_EPOCH_MSEC;
|
|
178
|
-
msec -= offset * 60_000;
|
|
179
178
|
return (0, rpcvalue_1.withOffset)(new Date(msec), offset ?? undefined);
|
|
180
179
|
}
|
|
181
180
|
case PackingSchema.Map: {
|
|
@@ -462,7 +461,7 @@ class ChainPackWriter {
|
|
|
462
461
|
}
|
|
463
462
|
writeDateTime(dt) {
|
|
464
463
|
this.ctx.putByte(PackingSchema.DateTime);
|
|
465
|
-
let msecs =
|
|
464
|
+
let msecs = dt.getTime() - SHV_EPOCH_MSEC;
|
|
466
465
|
if (msecs < 0) {
|
|
467
466
|
throw new RangeError('DateTime prior to 2018-02-02 are not supported in current ChainPack implementation.');
|
|
468
467
|
}
|
|
@@ -483,7 +482,7 @@ class ChainPackWriter {
|
|
|
483
482
|
bi |= 2n;
|
|
484
483
|
}
|
|
485
484
|
// save as signed int
|
|
486
|
-
this.writeUIntDataHelper(bi, '
|
|
485
|
+
this.writeUIntDataHelper(bi, 'Int');
|
|
487
486
|
}
|
|
488
487
|
writeDouble(double) {
|
|
489
488
|
this.ctx.putByte(PackingSchema.Double);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "libshv-js",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.10",
|
|
4
4
|
"description": "Typescript implementation of libshv",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@typescript-eslint/parser": "^8.56.1",
|
|
41
41
|
"@eslint/js": "^10.0.1",
|
|
42
42
|
"eslint": "^10.0.0",
|
|
43
|
-
"eslint-config-xo": "^0.
|
|
43
|
+
"eslint-config-xo": "^0.57.0",
|
|
44
44
|
"eslint-formatter-unix": "^9.0.1",
|
|
45
|
-
"eslint-plugin-unicorn": "^
|
|
45
|
+
"eslint-plugin-unicorn": "^71.0.0",
|
|
46
46
|
"typescript": "^6.0.2",
|
|
47
47
|
"typescript-eslint": "^8.46.1"
|
|
48
48
|
}
|