libshv-js 3.0.1 → 3.1.1

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.
@@ -17,9 +17,9 @@ jobs:
17
17
  runs-on: ubuntu-22.04
18
18
  steps:
19
19
  - uses: actions/checkout@v3
20
- - uses: denoland/setup-deno@v1
21
- with:
22
- deno-version: vx.x.x
20
+
21
+ - name: Compile
22
+ run: npx tsc
23
23
 
24
24
  - name: Run tests
25
- run: deno run test.ts
25
+ run: node test.js
package/.xo-config.json CHANGED
@@ -23,6 +23,7 @@
23
23
  "n/file-extension-in-import": "off",
24
24
  "promise-function-async": "off",
25
25
  "default-case": "off",
26
+ "import/extensions": "off",
26
27
  "prefer-promise-reject-errors": "off",
27
28
  "eslint-disable-next-line prefer-promise-reject-errors": "off",
28
29
  "unicorn/explicit-length-check": "off",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "libshv-js",
3
- "version": "3.0.1",
3
+ "version": "3.1.1",
4
4
  "description": "Typescript implementation of libshv",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/src/chainpack.ts CHANGED
@@ -1,6 +1,6 @@
1
- import {utf8ToString} from './cpon.ts';
2
- import {type RpcValue, type RpcValueType, type DateTime, Decimal, Double, IMap, Int, MetaMap, RpcValueWithMetaData, ShvMap, UInt, withOffset} from './rpcvalue.ts';
3
- import {UnpackContext, PackContext} from './cpcontext.ts';
1
+ import {utf8ToString} from './cpon';
2
+ import {type RpcValue, type RpcValueType, type DateTime, Decimal, Double, IMap, Int, MetaMap, RpcValueWithMetaData, ShvMap, UInt, withOffset} from './rpcvalue';
3
+ import {UnpackContext, PackContext} from './cpcontext';
4
4
 
5
5
  enum PackingSchema {
6
6
  IntThreshold = 64,
package/src/cpon.ts CHANGED
@@ -1,5 +1,5 @@
1
- import {type RpcValue, type RpcValueType, type DateTime, type List, Decimal, Double, IMap, Int, MetaMap, RpcValueWithMetaData, ShvMap, UInt, withOffset} from './rpcvalue.ts';
2
- import {PackContext, UnpackContext} from './cpcontext.ts';
1
+ import {type RpcValue, type RpcValueType, type DateTime, type List, Decimal, Double, IMap, Int, MetaMap, RpcValueWithMetaData, ShvMap, UInt, withOffset} from './rpcvalue';
2
+ import {PackContext, UnpackContext} from './cpcontext';
3
3
 
4
4
  const hexify = (byte: number) => {
5
5
  if (byte < 10) {
package/src/rpcmessage.ts CHANGED
@@ -1,6 +1,6 @@
1
- import {IMap, Int, MetaMap, type RpcValue, RpcValueWithMetaData} from './rpcvalue.ts';
2
- import {toCpon} from './cpon.ts';
3
- import {toChainPack} from './chainpack.ts';
1
+ import {IMap, Int, MetaMap, type RpcValue, RpcValueWithMetaData} from './rpcvalue';
2
+ import {toCpon} from './cpon';
3
+ import {toChainPack} from './chainpack';
4
4
 
5
5
  const TagRequestId = 8;
6
6
  const TagShvPath = 9;
@@ -166,7 +166,7 @@ class RpcMessage {
166
166
  return new ErrorType(this.value.value[KeyError] as ErrorMap);
167
167
  }
168
168
 
169
- if (this.value.value[KeyResult] !== undefined) {
169
+ if (Object.hasOwn(this.value.value.hasOwnProperty, KeyResult)) {
170
170
  return this.value.value[KeyResult];
171
171
  }
172
172
 
package/src/ws-client.ts CHANGED
@@ -1,7 +1,7 @@
1
- import {ChainPackReader, ChainpackProtocolType, ChainPackWriter} from './chainpack.ts';
2
- import {type CponReader, CponProtocolType, toCpon} from './cpon.ts';
3
- import {ERROR_MESSAGE, ErrorCode, ERROR_CODE, RpcError, RpcMessage, type RpcResponse, MethodCallTimeout} from './rpcmessage.ts';
4
- import {type RpcValue, type Null, Int, IMap, ShvMap} from './rpcvalue.ts';
1
+ import {ChainPackReader, ChainpackProtocolType, ChainPackWriter} from './chainpack';
2
+ import {type CponReader, CponProtocolType} from './cpon';
3
+ import {ERROR_MESSAGE, ErrorCode, ERROR_CODE, RpcMessage, type RpcResponse, MethodCallTimeout} from './rpcmessage';
4
+ import {type RpcValue, type Null, Int, IMap, ShvMap} from './rpcvalue';
5
5
 
6
6
  const DEFAULT_TIMEOUT = 5000;
7
7
 
package/test.ts CHANGED
@@ -1,6 +1,6 @@
1
- import {toChainPack, fromChainPack} from './src/chainpack.ts';
2
- import {toCpon, fromCpon} from './src/cpon.ts';
3
- import {type DateTime} from './src/rpcvalue.ts';
1
+ import {toChainPack, fromChainPack} from './src/chainpack';
2
+ import {toCpon, fromCpon} from './src/cpon';
3
+ import {type DateTime} from './src/rpcvalue';
4
4
 
5
5
  const checkEq = (e1: string | number, e2: string | number) => {
6
6
  if (e1 !== e2) {
package/tsconfig.json CHANGED
@@ -35,7 +35,6 @@
35
35
  // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
36
  // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
37
  // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
38
  // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
39
  // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
40
  // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
@@ -91,8 +90,8 @@
91
90
  // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
91
  // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
92
  // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
93
+ "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
94
+ "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
95
  // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
96
  // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
97
  // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */