From 6175c31fe5e54e6fa83d8f13c1ae042c305d8743 Mon Sep 17 00:00:00 2001 From: Weiliang Li Date: Fri, 25 Aug 2023 18:17:58 +0900 Subject: [PATCH] Revamp browser compatibility by removing Buffer-specific invokation --- .github/workflows/cd.yml | 4 +- .github/workflows/ci.yml | 5 +- README.md | 14 +- package.json | 14 +- pnpm-lock.yaml | 863 +++++++++++++++++++------------------ src/index.ts | 17 +- src/keys/PrivateKey.ts | 12 +- src/keys/PublicKey.ts | 10 +- src/keys/index.ts | 2 + tests/crypt.test.ts | 28 +- tests/integration.test.ts | 15 +- tests/keys.test.ts | 13 +- tests/utils/compat.test.ts | 2 +- 13 files changed, 509 insertions(+), 490 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 580bb79..5810e28 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -11,10 +11,10 @@ jobs: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 with: - version: "8.6.12" + version: "latest" - uses: actions/setup-node@v3 with: - node-version: 18 + node-version: 20 registry-url: "https://registry.npmjs.org" - run: pnpm install - run: npm test -- --bail --ci diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 479340c..4b7a508 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,14 @@ jobs: - uses: actions/checkout@v3 - uses: pnpm/action-setup@v2 with: - version: "8.6.12" + version: "latest" - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node }} cache: pnpm cache-dependency-path: pnpm-lock.yaml - - run: pnpm install && npm test -- --bail --ci + - run: pnpm install + - run: npm test -- --bail --ci - uses: codecov/codecov-action@v3 - run: npm run build && npm publish --dry-run diff --git a/README.md b/README.md index b2247e6..1e636f5 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,15 @@ Run the code below with `npx ts-node`. ```typescript > import { encrypt, decrypt, PrivateKey } from 'eciesjs' -> const k1 = new PrivateKey() -> const data = Buffer.from('this is a test') -> decrypt(k1.toHex(), encrypt(k1.publicKey.toHex(), data)).toString() -'this is a test' +> const sk = new PrivateKey() +> const data = Buffer.from('hello world🌍') +> decrypt(sk.toHex(), encrypt(sk.publicKey.toHex(), data)).toString() +'hello world🌍' ``` ## API -### `encrypt(receiverRawPK: string | Buffer, msg: Buffer): Buffer` +### `encrypt(receiverRawPK: string | Uint8Array, msg: Uint8Array): Buffer` Parameters: @@ -41,7 +41,7 @@ Parameters: Returns: **Buffer** -### `decrypt(receiverRawSK: string | Buffer, msg: Buffer): Buffer` +### `decrypt(receiverRawSK: string | Uint8Array, msg: Uint8Array): Buffer` Parameters: @@ -59,7 +59,7 @@ static fromHex(hex: string): PrivateKey; constructor(secret?: Uint8Array); toHex(): string; encapsulate(pk: PublicKey): Uint8Array; -multiply(pub: PublicKey, compressed?: boolean): Uint8Array; +multiply(pk: PublicKey, compressed?: boolean): Uint8Array; equals(other: PrivateKey): boolean; ``` diff --git a/package.json b/package.json index bd58afa..a6cd437 100644 --- a/package.json +++ b/package.json @@ -35,18 +35,18 @@ }, "dependencies": { "@noble/ciphers": "^0.2.0", - "@noble/curves": "^1.1.0", - "@noble/hashes": "^1.3.1" + "@noble/curves": "^1.2.0", + "@noble/hashes": "^1.3.2" }, "devDependencies": { - "@types/jest": "^29.5.3", - "@types/node": "^20.4.9", + "@types/jest": "^29.5.4", + "@types/node": "^20.5.6", "@types/node-fetch": "^2.6.4", "https-proxy-agent": "^7.0.1", - "jest": "^29.6.2", - "node-fetch": "^2.6.12", + "jest": "^29.6.4", + "node-fetch": "^2.7.0", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^5.1.6" + "typescript": "^5.2.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b279e14..10ad0f6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,19 +9,19 @@ dependencies: specifier: ^0.2.0 version: 0.2.0 '@noble/curves': - specifier: ^1.1.0 - version: 1.1.0 + specifier: ^1.2.0 + version: 1.2.0 '@noble/hashes': - specifier: ^1.3.1 - version: 1.3.1 + specifier: ^1.3.2 + version: 1.3.2 devDependencies: '@types/jest': - specifier: ^29.5.3 - version: 29.5.3 + specifier: ^29.5.4 + version: 29.5.4 '@types/node': - specifier: ^20.4.9 - version: 20.4.9 + specifier: ^20.5.6 + version: 20.5.6 '@types/node-fetch': specifier: ^2.6.4 version: 2.6.4 @@ -29,20 +29,20 @@ devDependencies: specifier: ^7.0.1 version: 7.0.1 jest: - specifier: ^29.6.2 - version: 29.6.2(@types/node@20.4.9)(ts-node@10.9.1) + specifier: ^29.6.4 + version: 29.6.4(@types/node@20.5.6)(ts-node@10.9.1) node-fetch: - specifier: ^2.6.12 - version: 2.6.12 + specifier: ^2.7.0 + version: 2.7.0 ts-jest: specifier: ^29.1.1 - version: 29.1.1(@babel/core@7.22.10)(jest@29.6.2)(typescript@5.1.6) + version: 29.1.1(@babel/core@7.22.11)(jest@29.6.4)(typescript@5.2.2) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@20.4.9)(typescript@5.1.6) + version: 10.9.1(@types/node@20.5.6)(typescript@5.2.2) typescript: - specifier: ^5.1.6 - version: 5.1.6 + specifier: ^5.2.2 + version: 5.2.2 packages: @@ -67,20 +67,20 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/core@7.22.10: - resolution: {integrity: sha512-fTmqbbUBAwCcre6zPzNngvsI0aNrPZe77AeqvDxWM9Nm+04RrJ3CAmGHA9f7lJQY6ZMhRztNemy4uslDxTX4Qw==} + /@babel/core@7.22.11: + resolution: {integrity: sha512-lh7RJrtPdhibbxndr6/xx0w8+CVlY5FJZiaSz908Fpy+G0xkBFTvwLcKJFF4PJxVfGhVWNebikpWGnOoC71juQ==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.22.10 '@babel/generator': 7.22.10 '@babel/helper-compilation-targets': 7.22.10 - '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.10) - '@babel/helpers': 7.22.10 - '@babel/parser': 7.22.10 + '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.11) + '@babel/helpers': 7.22.11 + '@babel/parser': 7.22.11 '@babel/template': 7.22.5 - '@babel/traverse': 7.22.10 - '@babel/types': 7.22.10 + '@babel/traverse': 7.22.11 + '@babel/types': 7.22.11 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -94,7 +94,7 @@ packages: resolution: {integrity: sha512-79KIf7YiWjjdZ81JnLujDRApWtl7BxTqWD88+FFdQEIOG8LJ0etDOM7CXuIgGJa55sGOwZVwuEsaLEm0PJ5/+A==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 '@jridgewell/gen-mapping': 0.3.3 '@jridgewell/trace-mapping': 0.3.19 jsesc: 2.5.2 @@ -121,30 +121,30 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-hoist-variables@7.22.5: resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-module-imports@7.22.5: resolution: {integrity: sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true - /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.10): + /@babel/helper-module-transforms@7.22.9(@babel/core@7.22.11): resolution: {integrity: sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-module-imports': 7.22.5 '@babel/helper-simple-access': 7.22.5 @@ -161,14 +161,14 @@ packages: resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-split-export-declaration@7.22.6: resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@babel/helper-string-parser@7.22.5: @@ -186,13 +186,13 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helpers@7.22.10: - resolution: {integrity: sha512-a41J4NW8HyZa1I1vAndrraTlPZ/eZoga2ZgS7fEr0tZJGVU4xqdE80CEm0CcNjha5EZ8fTBYLKHF0kqDUuAwQw==} + /@babel/helpers@7.22.11: + resolution: {integrity: sha512-vyOXC8PBWaGc5h7GMsNx68OH33cypkEDJCHvYVVgVbbxJDROYVtexSk0gK5iCF1xNjRIN2s8ai7hwkWDq5szWg==} engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.22.5 - '@babel/traverse': 7.22.10 - '@babel/types': 7.22.10 + '@babel/traverse': 7.22.11 + '@babel/types': 7.22.11 transitivePeerDependencies: - supports-color dev: true @@ -206,140 +206,140 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser@7.22.10: - resolution: {integrity: sha512-lNbdGsQb9ekfsnjFGhEiF4hfFqGgfOP3H3d27re3n+CGhNuTSUEQdfWk556sTLNTloczcdM5TYF2LhzmDQKyvQ==} + /@babel/parser@7.22.11: + resolution: {integrity: sha512-R5zb8eJIBPJriQtbH/htEQy4k7E2dHWlD2Y2VT07JCzwYZHBxV5ZYtM0UhXSNMT74LyxuM+b1jdL7pSesXbC/g==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true - /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.10): + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.22.11): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.10): + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.22.11): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.10): + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.22.11): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.10): + /@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.22.11): resolution: {integrity: sha512-gvyP4hZrgrs/wWMaocvxZ44Hw0b3W8Pe+cMxc8V1ULQ07oh8VNbIRaoD1LRZVTvD+0nieDKjfgKg89sD7rrKrg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.10): + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.22.11): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.10): + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.22.11): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.10): + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.22.11): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.10): + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.22.11): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true - /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.10): + /@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.22.11): resolution: {integrity: sha512-1mS2o03i7t1c6VzH6fdQ3OA8tcEIxwG18zIPRp+UY1Ihv6W+XZzBCVxExF9upussPXJ0xE9XRHwMoNs1ep/nRQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/helper-plugin-utils': 7.22.5 dev: true @@ -348,12 +348,12 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.10 - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 dev: true - /@babel/traverse@7.22.10: - resolution: {integrity: sha512-Q/urqV4pRByiNNpb/f5OSv28ZlGJiFiiTh+GAHktbIrkPhPbl90+uW6SmpoLyZqutrg9AEaEf3Q/ZBRHBXgxig==} + /@babel/traverse@7.22.11: + resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.22.10 @@ -362,16 +362,16 @@ packages: '@babel/helper-function-name': 7.22.5 '@babel/helper-hoist-variables': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types@7.22.10: - resolution: {integrity: sha512-obaoigiLrlDZ7TUQln/8m4mSqIW2QFeOrCQc9r+xsaHGNoplVNYlRVpsfE8Vj35GEm2ZH4ZhrNYogs/3fj85kg==} + /@babel/types@7.22.11: + resolution: {integrity: sha512-siazHiGuZRz9aB9NpHy9GOs9xiQPKnMzgdr493iI1M67vRXpnEq8ZOOKzezC5q7zwuQ6sDhdSp4SD9ixKSqKZg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.22.5 @@ -406,20 +406,20 @@ packages: engines: {node: '>=8'} dev: true - /@jest/console@29.6.2: - resolution: {integrity: sha512-0N0yZof5hi44HAR2pPS+ikJ3nzKNoZdVu8FffRf3wy47I7Dm7etk/3KetMdRUqzVd16V4O2m2ISpNTbnIuqy1w==} + /@jest/console@29.6.4: + resolution: {integrity: sha512-wNK6gC0Ha9QeEPSkeJedQuTQqxZYnDPuDcDhVuVatRvMkL4D0VTvFVZj+Yuh6caG2aOfzkUZ36KtCmLNtR02hw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 chalk: 4.1.2 - jest-message-util: 29.6.2 - jest-util: 29.6.2 + jest-message-util: 29.6.3 + jest-util: 29.6.3 slash: 3.0.0 dev: true - /@jest/core@29.6.2(ts-node@10.9.1): - resolution: {integrity: sha512-Oj+5B+sDMiMWLhPFF+4/DvHOf+U10rgvCLGPHP8Xlsy/7QxS51aU/eBngudHlJXnaWD5EohAgJ4js+T6pa+zOg==} + /@jest/core@29.6.4(ts-node@10.9.1): + resolution: {integrity: sha512-U/vq5ccNTSVgYH7mHnodHmCffGWHJnz/E1BEWlLuK5pM4FZmGfBn/nrJGLjUsSmyx3otCeqc1T31F4y08AMDLg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -427,32 +427,32 @@ packages: node-notifier: optional: true dependencies: - '@jest/console': 29.6.2 - '@jest/reporters': 29.6.2 - '@jest/test-result': 29.6.2 - '@jest/transform': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/console': 29.6.4 + '@jest/reporters': 29.6.4 + '@jest/test-result': 29.6.4 + '@jest/transform': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 - jest-changed-files: 29.5.0 - jest-config: 29.6.2(@types/node@20.4.9)(ts-node@10.9.1) - jest-haste-map: 29.6.2 - jest-message-util: 29.6.2 - jest-regex-util: 29.4.3 - jest-resolve: 29.6.2 - jest-resolve-dependencies: 29.6.2 - jest-runner: 29.6.2 - jest-runtime: 29.6.2 - jest-snapshot: 29.6.2 - jest-util: 29.6.2 - jest-validate: 29.6.2 - jest-watcher: 29.6.2 + jest-changed-files: 29.6.3 + jest-config: 29.6.4(@types/node@20.5.6)(ts-node@10.9.1) + jest-haste-map: 29.6.4 + jest-message-util: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.6.4 + jest-resolve-dependencies: 29.6.4 + jest-runner: 29.6.4 + jest-runtime: 29.6.4 + jest-snapshot: 29.6.4 + jest-util: 29.6.3 + jest-validate: 29.6.3 + jest-watcher: 29.6.4 micromatch: 4.0.5 - pretty-format: 29.6.2 + pretty-format: 29.6.3 slash: 3.0.0 strip-ansi: 6.0.1 transitivePeerDependencies: @@ -461,59 +461,59 @@ packages: - ts-node dev: true - /@jest/environment@29.6.2: - resolution: {integrity: sha512-AEcW43C7huGd/vogTddNNTDRpO6vQ2zaQNrttvWV18ArBx9Z56h7BIsXkNFJVOO4/kblWEQz30ckw0+L3izc+Q==} + /@jest/environment@29.6.4: + resolution: {integrity: sha512-sQ0SULEjA1XUTHmkBRl7A1dyITM9yb1yb3ZNKPX3KlTd6IG7mWUe3e2yfExtC2Zz1Q+mMckOLHmL/qLiuQJrBQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 - jest-mock: 29.6.2 + '@jest/fake-timers': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 + jest-mock: 29.6.3 dev: true - /@jest/expect-utils@29.6.2: - resolution: {integrity: sha512-6zIhM8go3RV2IG4aIZaZbxwpOzz3ZiM23oxAlkquOIole+G6TrbeXnykxWYlqF7kz2HlBjdKtca20x9atkEQYg==} + /@jest/expect-utils@29.6.4: + resolution: {integrity: sha512-FEhkJhqtvBwgSpiTrocquJCdXPsyvNKcl/n7A3u7X4pVoF4bswm11c9d4AV+kfq2Gpv/mM8x7E7DsRvH+djkrg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 dev: true - /@jest/expect@29.6.2: - resolution: {integrity: sha512-m6DrEJxVKjkELTVAztTLyS/7C92Y2b0VYqmDROYKLLALHn8T/04yPs70NADUYPrV3ruI+H3J0iUIuhkjp7vkfg==} + /@jest/expect@29.6.4: + resolution: {integrity: sha512-Warhsa7d23+3X5bLbrbYvaehcgX5TLYhI03JKoedTiI8uJU4IhqYBWF7OSSgUyz4IgLpUYPkK0AehA5/fRclAA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - expect: 29.6.2 - jest-snapshot: 29.6.2 + expect: 29.6.4 + jest-snapshot: 29.6.4 transitivePeerDependencies: - supports-color dev: true - /@jest/fake-timers@29.6.2: - resolution: {integrity: sha512-euZDmIlWjm1Z0lJ1D0f7a0/y5Kh/koLFMUBE5SUYWrmy8oNhJpbTBDAP6CxKnadcMLDoDf4waRYCe35cH6G6PA==} + /@jest/fake-timers@29.6.4: + resolution: {integrity: sha512-6UkCwzoBK60edXIIWb0/KWkuj7R7Qq91vVInOe3De6DSpaEiqjKcJw4F7XUet24Wupahj9J6PlR09JqJ5ySDHw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 + '@jest/types': 29.6.3 '@sinonjs/fake-timers': 10.3.0 - '@types/node': 20.4.9 - jest-message-util: 29.6.2 - jest-mock: 29.6.2 - jest-util: 29.6.2 + '@types/node': 20.5.6 + jest-message-util: 29.6.3 + jest-mock: 29.6.3 + jest-util: 29.6.3 dev: true - /@jest/globals@29.6.2: - resolution: {integrity: sha512-cjuJmNDjs6aMijCmSa1g2TNG4Lby/AeU7/02VtpW+SLcZXzOLK2GpN2nLqcFjmhy3B3AoPeQVx7BnyOf681bAw==} + /@jest/globals@29.6.4: + resolution: {integrity: sha512-wVIn5bdtjlChhXAzVXavcY/3PEjf4VqM174BM3eGL5kMxLiZD5CLnbmkEyA1Dwh9q8XjP6E8RwjBsY/iCWrWsA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.6.2 - '@jest/expect': 29.6.2 - '@jest/types': 29.6.1 - jest-mock: 29.6.2 + '@jest/environment': 29.6.4 + '@jest/expect': 29.6.4 + '@jest/types': 29.6.3 + jest-mock: 29.6.3 transitivePeerDependencies: - supports-color dev: true - /@jest/reporters@29.6.2: - resolution: {integrity: sha512-sWtijrvIav8LgfJZlrGCdN0nP2EWbakglJY49J1Y5QihcQLfy7ovyxxjJBRXMNltgt4uPtEcFmIMbVshEDfFWw==} + /@jest/reporters@29.6.4: + resolution: {integrity: sha512-sxUjWxm7QdchdrD3NfWKrL8FBsortZeibSJv4XLjESOOjSUOkjQcb0ZHJwfhEGIvBvTluTzfG2yZWZhkrXJu8g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -522,25 +522,25 @@ packages: optional: true dependencies: '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.6.2 - '@jest/test-result': 29.6.2 - '@jest/transform': 29.6.2 - '@jest/types': 29.6.1 + '@jest/console': 29.6.4 + '@jest/test-result': 29.6.4 + '@jest/transform': 29.6.4 + '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 - '@types/node': 20.4.9 + '@types/node': 20.5.6 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 glob: 7.2.3 graceful-fs: 4.2.11 istanbul-lib-coverage: 3.2.0 - istanbul-lib-instrument: 5.2.1 + istanbul-lib-instrument: 6.0.0 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.6 - jest-message-util: 29.6.2 - jest-util: 29.6.2 - jest-worker: 29.6.2 + jest-message-util: 29.6.3 + jest-util: 29.6.3 + jest-worker: 29.6.4 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 @@ -549,15 +549,15 @@ packages: - supports-color dev: true - /@jest/schemas@29.6.0: - resolution: {integrity: sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==} + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@sinclair/typebox': 0.27.8 dev: true - /@jest/source-map@29.6.0: - resolution: {integrity: sha512-oA+I2SHHQGxDCZpbrsCQSoMLb3Bz547JnM+jUr9qEbuw0vQlWZfpPS7CO9J7XiwKicEz9OFn/IYoLkkiUD7bzA==} + /@jest/source-map@29.6.3: + resolution: {integrity: sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jridgewell/trace-mapping': 0.3.19 @@ -565,41 +565,41 @@ packages: graceful-fs: 4.2.11 dev: true - /@jest/test-result@29.6.2: - resolution: {integrity: sha512-3VKFXzcV42EYhMCsJQURptSqnyjqCGbtLuX5Xxb6Pm6gUf1wIRIl+mandIRGJyWKgNKYF9cnstti6Ls5ekduqw==} + /@jest/test-result@29.6.4: + resolution: {integrity: sha512-uQ1C0AUEN90/dsyEirgMLlouROgSY+Wc/JanVVk0OiUKa5UFh7sJpMEM3aoUBAz2BRNvUJ8j3d294WFuRxSyOQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.6.2 - '@jest/types': 29.6.1 + '@jest/console': 29.6.4 + '@jest/types': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.2 dev: true - /@jest/test-sequencer@29.6.2: - resolution: {integrity: sha512-GVYi6PfPwVejO7slw6IDO0qKVum5jtrJ3KoLGbgBWyr2qr4GaxFV6su+ZAjdTX75Sr1DkMFRk09r2ZVa+wtCGw==} + /@jest/test-sequencer@29.6.4: + resolution: {integrity: sha512-E84M6LbpcRq3fT4ckfKs9ryVanwkaIB0Ws9bw3/yP4seRLg/VaCZ/LgW0MCq5wwk4/iP/qnilD41aj2fsw2RMg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.6.2 + '@jest/test-result': 29.6.4 graceful-fs: 4.2.11 - jest-haste-map: 29.6.2 + jest-haste-map: 29.6.4 slash: 3.0.0 dev: true - /@jest/transform@29.6.2: - resolution: {integrity: sha512-ZqCqEISr58Ce3U+buNFJYUktLJZOggfyvR+bZMaiV1e8B1SIvJbwZMrYz3gx/KAPn9EXmOmN+uB08yLCjWkQQg==} + /@jest/transform@29.6.4: + resolution: {integrity: sha512-8thgRSiXUqtr/pPGY/OsyHuMjGyhVnWrFAwoxmIemlBuiMyU1WFs0tXoNxzcr4A4uErs/ABre76SGmrr5ab/AA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.22.10 - '@jest/types': 29.6.1 + '@babel/core': 7.22.11 + '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.19 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 graceful-fs: 4.2.11 - jest-haste-map: 29.6.2 - jest-regex-util: 29.4.3 - jest-util: 29.6.2 + jest-haste-map: 29.6.4 + jest-regex-util: 29.6.3 + jest-util: 29.6.3 micromatch: 4.0.5 pirates: 4.0.6 slash: 3.0.0 @@ -608,14 +608,14 @@ packages: - supports-color dev: true - /@jest/types@29.6.1: - resolution: {integrity: sha512-tPKQNMPuXgvdOn2/Lg9HNfUvjYVGolt04Hp03f5hAk878uwOLikN+JzeLY0HcVgKgFl9Hs3EIqpu3WX27XNhnw==} + /@jest/types@29.6.3: + resolution: {integrity: sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.6.0 + '@jest/schemas': 29.6.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 20.4.9 + '@types/node': 20.5.6 '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true @@ -661,14 +661,14 @@ packages: resolution: {integrity: sha512-6YBxJDAapHSdd3bLDv6x2wRPwq4QFMUaB3HvljNBUTThDd12eSm7/3F+2lnfzx2jvM+S6Nsy0jEt9QbPqSwqRw==} dev: false - /@noble/curves@1.1.0: - resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} + /@noble/curves@1.2.0: + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} dependencies: - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 dev: false - /@noble/hashes@1.3.1: - resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} + /@noble/hashes@1.3.2: + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} engines: {node: '>= 16'} dev: false @@ -707,8 +707,8 @@ packages: /@types/babel__core@7.20.1: resolution: {integrity: sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==} dependencies: - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.20.1 @@ -717,26 +717,26 @@ packages: /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.22.10 - '@babel/types': 7.22.10 + '@babel/parser': 7.22.11 + '@babel/types': 7.22.11 dev: true /@types/babel__traverse@7.20.1: resolution: {integrity: sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==} dependencies: - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 dev: true /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 20.4.9 + '@types/node': 20.5.6 dev: true /@types/istanbul-lib-coverage@2.0.4: @@ -755,22 +755,22 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest@29.5.3: - resolution: {integrity: sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==} + /@types/jest@29.5.4: + resolution: {integrity: sha512-PhglGmhWeD46FYOVLt3X7TiWjzwuVGW9wG/4qocPevXMjCmrIc5b6db9WjeGE4QYVpUAWMDv3v0IiBwObY289A==} dependencies: - expect: 29.6.2 - pretty-format: 29.6.2 + expect: 29.6.4 + pretty-format: 29.6.3 dev: true /@types/node-fetch@2.6.4: resolution: {integrity: sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg==} dependencies: - '@types/node': 20.4.9 + '@types/node': 20.5.6 form-data: 3.0.1 dev: true - /@types/node@20.4.9: - resolution: {integrity: sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==} + /@types/node@20.5.6: + resolution: {integrity: sha512-Gi5wRGPbbyOTX+4Y2iULQ27oUPrefaB0PxGQJnfyWN3kvEDGM3mIB5M/gQLmitZf7A9FmLeaqxD3L1CXpm3VKQ==} dev: true /@types/stack-utils@2.0.1: @@ -860,17 +860,17 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true - /babel-jest@29.6.2(@babel/core@7.22.10): - resolution: {integrity: sha512-BYCzImLos6J3BH/+HvUCHG1dTf2MzmAB4jaVxHV+29RZLjR29XuYTmsf2sdDwkrb+FczkGo3kOhE7ga6sI0P4A==} + /babel-jest@29.6.4(@babel/core@7.22.11): + resolution: {integrity: sha512-meLj23UlSLddj6PC+YTOFRgDAtjnZom8w/ACsrx0gtPtv5cJZk0A5Unk5bV4wixD7XaPCN1fQvpww8czkZURmw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.22.10 - '@jest/transform': 29.6.2 + '@babel/core': 7.22.11 + '@jest/transform': 29.6.4 '@types/babel__core': 7.20.1 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.5.0(@babel/core@7.22.10) + babel-preset-jest: 29.6.3(@babel/core@7.22.11) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -891,45 +891,45 @@ packages: - supports-color dev: true - /babel-plugin-jest-hoist@29.5.0: - resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} + /babel-plugin-jest-hoist@29.6.3: + resolution: {integrity: sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/template': 7.22.5 - '@babel/types': 7.22.10 + '@babel/types': 7.22.11 '@types/babel__core': 7.20.1 '@types/babel__traverse': 7.20.1 dev: true - /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.10): + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.22.11): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.10 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.10) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.10) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.10) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.10) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.10) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.10) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.10) - dev: true - - /babel-preset-jest@29.5.0(@babel/core@7.22.10): - resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} + '@babel/core': 7.22.11 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.22.11) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.22.11) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.22.11) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.22.11) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.22.11) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.22.11) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.22.11) + dev: true + + /babel-preset-jest@29.6.3(@babel/core@7.22.11): + resolution: {integrity: sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.22.10 - babel-plugin-jest-hoist: 29.5.0 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.10) + '@babel/core': 7.22.11 + babel-plugin-jest-hoist: 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.11) dev: true /balanced-match@1.0.2: @@ -955,8 +955,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001519 - electron-to-chromium: 1.4.490 + caniuse-lite: 1.0.30001523 + electron-to-chromium: 1.4.502 node-releases: 2.0.13 update-browserslist-db: 1.0.11(browserslist@4.21.10) dev: true @@ -993,8 +993,8 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite@1.0.30001519: - resolution: {integrity: sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==} + /caniuse-lite@1.0.30001523: + resolution: {integrity: sha512-I5q5cisATTPZ1mc588Z//pj/Ox80ERYDfR71YnvY7raS/NOk8xXlZcB0sF7JdqaV//kOaa6aus7lRfpdnt1eBA==} dev: true /chalk@2.4.2: @@ -1135,8 +1135,8 @@ packages: engines: {node: '>=8'} dev: true - /diff-sequences@29.4.3: - resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true @@ -1145,8 +1145,8 @@ packages: engines: {node: '>=0.3.1'} dev: true - /electron-to-chromium@1.4.490: - resolution: {integrity: sha512-6s7NVJz+sATdYnIwhdshx/N/9O6rvMxmhVoDSDFdj6iA45gHR8EQje70+RYsF4GeB+k0IeNSBnP7yG9ZXJFr7A==} + /electron-to-chromium@1.4.502: + resolution: {integrity: sha512-xqeGw3Gr6o3uyHy/yKjdnDQHY2RQvXcGC2cfHjccK1IGkH6cX1WQBN8EeC/YpwPhGkBaikDTecJ8+ssxSVRQlw==} dev: true /emittery@0.13.1: @@ -1205,16 +1205,15 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /expect@29.6.2: - resolution: {integrity: sha512-iAErsLxJ8C+S02QbLAwgSGSezLQK+XXRDt8IuFXFpwCNw2ECmzZSmjKcCaFVp5VRMk+WAvz6h6jokzEzBFZEuA==} + /expect@29.6.4: + resolution: {integrity: sha512-F2W2UyQ8XYyftHT57dtfg8Ue3X5qLgm2sSug0ivvLRH/VKNRL/pDxg/TH7zVzbQB0tu80clNFy6LU7OS/VSEKA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/expect-utils': 29.6.2 - '@types/node': 20.4.9 - jest-get-type: 29.4.3 - jest-matcher-utils: 29.6.2 - jest-message-util: 29.6.2 - jest-util: 29.6.2 + '@jest/expect-utils': 29.6.4 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.6.4 + jest-message-util: 29.6.3 + jest-util: 29.6.3 dev: true /fast-json-stable-stringify@2.1.0: @@ -1255,8 +1254,8 @@ packages: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents@2.3.2: - resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + /fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true @@ -1411,8 +1410,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.22.10 - '@babel/parser': 7.22.10 + '@babel/core': 7.22.11 + '@babel/parser': 7.22.11 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 @@ -1420,6 +1419,19 @@ packages: - supports-color dev: true + /istanbul-lib-instrument@6.0.0: + resolution: {integrity: sha512-x58orMzEVfzPUKqlbLd1hXCnySCxKdDKa6Rjg97CwuLLRI4g3FHTdnExu1OqffVFay6zeMW+T6/DowFLndWnIw==} + engines: {node: '>=10'} + dependencies: + '@babel/core': 7.22.11 + '@babel/parser': 7.22.11 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.0 + semver: 7.5.4 + transitivePeerDependencies: + - supports-color + dev: true + /istanbul-lib-report@3.0.1: resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} engines: {node: '>=10'} @@ -1448,35 +1460,36 @@ packages: istanbul-lib-report: 3.0.1 dev: true - /jest-changed-files@29.5.0: - resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} + /jest-changed-files@29.6.3: + resolution: {integrity: sha512-G5wDnElqLa4/c66ma5PG9eRjE342lIbF6SUnTJi26C3J28Fv2TVY2rOyKB9YGbSA5ogwevgmxc4j4aVjrEK6Yg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: execa: 5.1.1 + jest-util: 29.6.3 p-limit: 3.1.0 dev: true - /jest-circus@29.6.2: - resolution: {integrity: sha512-G9mN+KOYIUe2sB9kpJkO9Bk18J4dTDArNFPwoZ7WKHKel55eKIS/u2bLthxgojwlf9NLCVQfgzM/WsOVvoC6Fw==} + /jest-circus@29.6.4: + resolution: {integrity: sha512-YXNrRyntVUgDfZbjXWBMPslX1mQ8MrSG0oM/Y06j9EYubODIyHWP8hMUbjbZ19M3M+zamqEur7O80HODwACoJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.6.2 - '@jest/expect': 29.6.2 - '@jest/test-result': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/environment': 29.6.4 + '@jest/expect': 29.6.4 + '@jest/test-result': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.1 is-generator-fn: 2.1.0 - jest-each: 29.6.2 - jest-matcher-utils: 29.6.2 - jest-message-util: 29.6.2 - jest-runtime: 29.6.2 - jest-snapshot: 29.6.2 - jest-util: 29.6.2 + jest-each: 29.6.3 + jest-matcher-utils: 29.6.4 + jest-message-util: 29.6.3 + jest-runtime: 29.6.4 + jest-snapshot: 29.6.4 + jest-util: 29.6.3 p-limit: 3.1.0 - pretty-format: 29.6.2 + pretty-format: 29.6.3 pure-rand: 6.0.2 slash: 3.0.0 stack-utils: 2.0.6 @@ -1485,8 +1498,8 @@ packages: - supports-color dev: true - /jest-cli@29.6.2(@types/node@20.4.9)(ts-node@10.9.1): - resolution: {integrity: sha512-TT6O247v6dCEX2UGHGyflMpxhnrL0DNqP2fRTKYm3nJJpCTfXX3GCMQPGFjXDoj0i5/Blp3jriKXFgdfmbYB6Q==} + /jest-cli@29.6.4(@types/node@20.5.6)(ts-node@10.9.1): + resolution: {integrity: sha512-+uMCQ7oizMmh8ZwRfZzKIEszFY9ksjjEQnTEMTaL7fYiL3Kw4XhqT9bYh+A4DQKUb67hZn2KbtEnDuHvcgK4pQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -1495,16 +1508,16 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.6.2(ts-node@10.9.1) - '@jest/test-result': 29.6.2 - '@jest/types': 29.6.1 + '@jest/core': 29.6.4(ts-node@10.9.1) + '@jest/test-result': 29.6.4 + '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.6.2(@types/node@20.4.9)(ts-node@10.9.1) - jest-util: 29.6.2 - jest-validate: 29.6.2 + jest-config: 29.6.4(@types/node@20.5.6)(ts-node@10.9.1) + jest-util: 29.6.3 + jest-validate: 29.6.3 prompts: 2.4.2 yargs: 17.7.2 transitivePeerDependencies: @@ -1514,8 +1527,8 @@ packages: - ts-node dev: true - /jest-config@29.6.2(@types/node@20.4.9)(ts-node@10.9.1): - resolution: {integrity: sha512-VxwFOC8gkiJbuodG9CPtMRjBUNZEHxwfQXmIudSTzFWxaci3Qub1ddTRbFNQlD/zUeaifLndh/eDccFX4wCMQw==} + /jest-config@29.6.4(@types/node@20.5.6)(ts-node@10.9.1): + resolution: {integrity: sha512-JWohr3i9m2cVpBumQFv2akMEnFEPVOh+9L2xIBJhJ0zOaci2ZXuKJj0tgMKQCBZAKA09H049IR4HVS/43Qb19A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@types/node': '*' @@ -1526,142 +1539,142 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.22.10 - '@jest/test-sequencer': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 - babel-jest: 29.6.2(@babel/core@7.22.10) + '@babel/core': 7.22.11 + '@jest/test-sequencer': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 + babel-jest: 29.6.4(@babel/core@7.22.11) chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 glob: 7.2.3 graceful-fs: 4.2.11 - jest-circus: 29.6.2 - jest-environment-node: 29.6.2 - jest-get-type: 29.4.3 - jest-regex-util: 29.4.3 - jest-resolve: 29.6.2 - jest-runner: 29.6.2 - jest-util: 29.6.2 - jest-validate: 29.6.2 + jest-circus: 29.6.4 + jest-environment-node: 29.6.4 + jest-get-type: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.6.4 + jest-runner: 29.6.4 + jest-util: 29.6.3 + jest-validate: 29.6.3 micromatch: 4.0.5 parse-json: 5.2.0 - pretty-format: 29.6.2 + pretty-format: 29.6.3 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1(@types/node@20.4.9)(typescript@5.1.6) + ts-node: 10.9.1(@types/node@20.5.6)(typescript@5.2.2) transitivePeerDependencies: - babel-plugin-macros - supports-color dev: true - /jest-diff@29.6.2: - resolution: {integrity: sha512-t+ST7CB9GX5F2xKwhwCf0TAR17uNDiaPTZnVymP9lw0lssa9vG+AFyDZoeIHStU3WowFFwT+ky+er0WVl2yGhA==} + /jest-diff@29.6.4: + resolution: {integrity: sha512-9F48UxR9e4XOEZvoUXEHSWY4qC4zERJaOfrbBg9JpbJOO43R1vN76REt/aMGZoY6GD5g84nnJiBIVlscegefpw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - diff-sequences: 29.4.3 - jest-get-type: 29.4.3 - pretty-format: 29.6.2 + diff-sequences: 29.6.3 + jest-get-type: 29.6.3 + pretty-format: 29.6.3 dev: true - /jest-docblock@29.4.3: - resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} + /jest-docblock@29.6.3: + resolution: {integrity: sha512-2+H+GOTQBEm2+qFSQ7Ma+BvyV+waiIFxmZF5LdpBsAEjWX8QYjSCa4FrkIYtbfXUJJJnFCYrOtt6TZ+IAiTjBQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 dev: true - /jest-each@29.6.2: - resolution: {integrity: sha512-MsrsqA0Ia99cIpABBc3izS1ZYoYfhIy0NNWqPSE0YXbQjwchyt6B1HD2khzyPe1WiJA7hbxXy77ZoUQxn8UlSw==} + /jest-each@29.6.3: + resolution: {integrity: sha512-KoXfJ42k8cqbkfshW7sSHcdfnv5agDdHCPA87ZBdmHP+zJstTJc0ttQaJ/x7zK6noAL76hOuTIJ6ZkQRS5dcyg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 + '@jest/types': 29.6.3 chalk: 4.1.2 - jest-get-type: 29.4.3 - jest-util: 29.6.2 - pretty-format: 29.6.2 + jest-get-type: 29.6.3 + jest-util: 29.6.3 + pretty-format: 29.6.3 dev: true - /jest-environment-node@29.6.2: - resolution: {integrity: sha512-YGdFeZ3T9a+/612c5mTQIllvWkddPbYcN2v95ZH24oWMbGA4GGS2XdIF92QMhUhvrjjuQWYgUGW2zawOyH63MQ==} + /jest-environment-node@29.6.4: + resolution: {integrity: sha512-i7SbpH2dEIFGNmxGCpSc2w9cA4qVD+wfvg2ZnfQ7XVrKL0NA5uDVBIiGH8SR4F0dKEv/0qI5r+aDomDf04DpEQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.6.2 - '@jest/fake-timers': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 - jest-mock: 29.6.2 - jest-util: 29.6.2 + '@jest/environment': 29.6.4 + '@jest/fake-timers': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 + jest-mock: 29.6.3 + jest-util: 29.6.3 dev: true - /jest-get-type@29.4.3: - resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} + /jest-get-type@29.6.3: + resolution: {integrity: sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-haste-map@29.6.2: - resolution: {integrity: sha512-+51XleTDAAysvU8rT6AnS1ZJ+WHVNqhj1k6nTvN2PYP+HjU3kqlaKQ1Lnw3NYW3bm2r8vq82X0Z1nDDHZMzHVA==} + /jest-haste-map@29.6.4: + resolution: {integrity: sha512-12Ad+VNTDHxKf7k+M65sviyynRoZYuL1/GTuhEVb8RYsNSNln71nANRb/faSyWvx0j+gHcivChXHIoMJrGYjog==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 + '@jest/types': 29.6.3 '@types/graceful-fs': 4.1.6 - '@types/node': 20.4.9 + '@types/node': 20.5.6 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 - jest-regex-util: 29.4.3 - jest-util: 29.6.2 - jest-worker: 29.6.2 + jest-regex-util: 29.6.3 + jest-util: 29.6.3 + jest-worker: 29.6.4 micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true - /jest-leak-detector@29.6.2: - resolution: {integrity: sha512-aNqYhfp5uYEO3tdWMb2bfWv6f0b4I0LOxVRpnRLAeque2uqOVVMLh6khnTcE2qJ5wAKop0HcreM1btoysD6bPQ==} + /jest-leak-detector@29.6.3: + resolution: {integrity: sha512-0kfbESIHXYdhAdpLsW7xdwmYhLf1BRu4AA118/OxFm0Ho1b2RcTmO4oF6aAMaxpxdxnJ3zve2rgwzNBD4Zbm7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.4.3 - pretty-format: 29.6.2 + jest-get-type: 29.6.3 + pretty-format: 29.6.3 dev: true - /jest-matcher-utils@29.6.2: - resolution: {integrity: sha512-4LiAk3hSSobtomeIAzFTe+N8kL6z0JtF3n6I4fg29iIW7tt99R7ZcIFW34QkX+DuVrf+CUe6wuVOpm7ZKFJzZQ==} + /jest-matcher-utils@29.6.4: + resolution: {integrity: sha512-KSzwyzGvK4HcfnserYqJHYi7sZVqdREJ9DMPAKVbS98JsIAvumihaNUbjrWw0St7p9IY7A9UskCW5MYlGmBQFQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 29.6.2 - jest-get-type: 29.4.3 - pretty-format: 29.6.2 + jest-diff: 29.6.4 + jest-get-type: 29.6.3 + pretty-format: 29.6.3 dev: true - /jest-message-util@29.6.2: - resolution: {integrity: sha512-vnIGYEjoPSuRqV8W9t+Wow95SDp6KPX2Uf7EoeG9G99J2OVh7OSwpS4B6J0NfpEIpfkBNHlBZpA2rblEuEFhZQ==} + /jest-message-util@29.6.3: + resolution: {integrity: sha512-FtzaEEHzjDpQp51HX4UMkPZjy46ati4T5pEMyM6Ik48ztu4T9LQplZ6OsimHx7EuM9dfEh5HJa6D3trEftu3dA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.22.10 - '@jest/types': 29.6.1 + '@jest/types': 29.6.3 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.11 micromatch: 4.0.5 - pretty-format: 29.6.2 + pretty-format: 29.6.3 slash: 3.0.0 stack-utils: 2.0.6 dev: true - /jest-mock@29.6.2: - resolution: {integrity: sha512-hoSv3lb3byzdKfwqCuT6uTscan471GUECqgNYykg6ob0yiAw3zYc7OrPnI9Qv8Wwoa4lC7AZ9hyS4AiIx5U2zg==} + /jest-mock@29.6.3: + resolution: {integrity: sha512-Z7Gs/mOyTSR4yPsaZ72a/MtuK6RnC3JYqWONe48oLaoEcYwEDxqvbXz85G4SJrm2Z5Ar9zp6MiHF4AlFlRM4Pg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 - '@types/node': 20.4.9 - jest-util: 29.6.2 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 + jest-util: 29.6.3 dev: true - /jest-pnp-resolver@1.2.3(jest-resolve@29.6.2): + /jest-pnp-resolver@1.2.3(jest-resolve@29.6.4): resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} peerDependencies: @@ -1670,176 +1683,176 @@ packages: jest-resolve: optional: true dependencies: - jest-resolve: 29.6.2 + jest-resolve: 29.6.4 dev: true - /jest-regex-util@29.4.3: - resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} + /jest-regex-util@29.6.3: + resolution: {integrity: sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-resolve-dependencies@29.6.2: - resolution: {integrity: sha512-LGqjDWxg2fuQQm7ypDxduLu/m4+4Lb4gczc13v51VMZbVP5tSBILqVx8qfWcsdP8f0G7aIqByIALDB0R93yL+w==} + /jest-resolve-dependencies@29.6.4: + resolution: {integrity: sha512-7+6eAmr1ZBF3vOAJVsfLj1QdqeXG+WYhidfLHBRZqGN24MFRIiKG20ItpLw2qRAsW/D2ZUUmCNf6irUr/v6KHA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-regex-util: 29.4.3 - jest-snapshot: 29.6.2 + jest-regex-util: 29.6.3 + jest-snapshot: 29.6.4 transitivePeerDependencies: - supports-color dev: true - /jest-resolve@29.6.2: - resolution: {integrity: sha512-G/iQUvZWI5e3SMFssc4ug4dH0aZiZpsDq9o1PtXTV1210Ztyb2+w+ZgQkB3iOiC5SmAEzJBOHWz6Hvrd+QnNPw==} + /jest-resolve@29.6.4: + resolution: {integrity: sha512-fPRq+0vcxsuGlG0O3gyoqGTAxasagOxEuyoxHeyxaZbc9QNek0AmJWSkhjlMG+mTsj+8knc/mWb3fXlRNVih7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 graceful-fs: 4.2.11 - jest-haste-map: 29.6.2 - jest-pnp-resolver: 1.2.3(jest-resolve@29.6.2) - jest-util: 29.6.2 - jest-validate: 29.6.2 + jest-haste-map: 29.6.4 + jest-pnp-resolver: 1.2.3(jest-resolve@29.6.4) + jest-util: 29.6.3 + jest-validate: 29.6.3 resolve: 1.22.4 resolve.exports: 2.0.2 slash: 3.0.0 dev: true - /jest-runner@29.6.2: - resolution: {integrity: sha512-wXOT/a0EspYgfMiYHxwGLPCZfC0c38MivAlb2lMEAlwHINKemrttu1uSbcGbfDV31sFaPWnWJPmb2qXM8pqZ4w==} + /jest-runner@29.6.4: + resolution: {integrity: sha512-SDaLrMmtVlQYDuG0iSPYLycG8P9jLI+fRm8AF/xPKhYDB2g6xDWjXBrR5M8gEWsK6KVFlebpZ4QsrxdyIX1Jaw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.6.2 - '@jest/environment': 29.6.2 - '@jest/test-result': 29.6.2 - '@jest/transform': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/console': 29.6.4 + '@jest/environment': 29.6.4 + '@jest/test-result': 29.6.4 + '@jest/transform': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 - jest-docblock: 29.4.3 - jest-environment-node: 29.6.2 - jest-haste-map: 29.6.2 - jest-leak-detector: 29.6.2 - jest-message-util: 29.6.2 - jest-resolve: 29.6.2 - jest-runtime: 29.6.2 - jest-util: 29.6.2 - jest-watcher: 29.6.2 - jest-worker: 29.6.2 + jest-docblock: 29.6.3 + jest-environment-node: 29.6.4 + jest-haste-map: 29.6.4 + jest-leak-detector: 29.6.3 + jest-message-util: 29.6.3 + jest-resolve: 29.6.4 + jest-runtime: 29.6.4 + jest-util: 29.6.3 + jest-watcher: 29.6.4 + jest-worker: 29.6.4 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: - supports-color dev: true - /jest-runtime@29.6.2: - resolution: {integrity: sha512-2X9dqK768KufGJyIeLmIzToDmsN0m7Iek8QNxRSI/2+iPFYHF0jTwlO3ftn7gdKd98G/VQw9XJCk77rbTGZnJg==} + /jest-runtime@29.6.4: + resolution: {integrity: sha512-s/QxMBLvmwLdchKEjcLfwzP7h+jsHvNEtxGP5P+Fl1FMaJX2jMiIqe4rJw4tFprzCwuSvVUo9bn0uj4gNRXsbA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.6.2 - '@jest/fake-timers': 29.6.2 - '@jest/globals': 29.6.2 - '@jest/source-map': 29.6.0 - '@jest/test-result': 29.6.2 - '@jest/transform': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/environment': 29.6.4 + '@jest/fake-timers': 29.6.4 + '@jest/globals': 29.6.4 + '@jest/source-map': 29.6.3 + '@jest/test-result': 29.6.4 + '@jest/transform': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 chalk: 4.1.2 cjs-module-lexer: 1.2.3 collect-v8-coverage: 1.0.2 glob: 7.2.3 graceful-fs: 4.2.11 - jest-haste-map: 29.6.2 - jest-message-util: 29.6.2 - jest-mock: 29.6.2 - jest-regex-util: 29.4.3 - jest-resolve: 29.6.2 - jest-snapshot: 29.6.2 - jest-util: 29.6.2 + jest-haste-map: 29.6.4 + jest-message-util: 29.6.3 + jest-mock: 29.6.3 + jest-regex-util: 29.6.3 + jest-resolve: 29.6.4 + jest-snapshot: 29.6.4 + jest-util: 29.6.3 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: - supports-color dev: true - /jest-snapshot@29.6.2: - resolution: {integrity: sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==} + /jest-snapshot@29.6.4: + resolution: {integrity: sha512-VC1N8ED7+4uboUKGIDsbvNAZb6LakgIPgAF4RSpF13dN6YaMokfRqO+BaqK4zIh6X3JffgwbzuGqDEjHm/MrvA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 '@babel/generator': 7.22.10 - '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.10) - '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.10) - '@babel/types': 7.22.10 - '@jest/expect-utils': 29.6.2 - '@jest/transform': 29.6.2 - '@jest/types': 29.6.1 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.10) + '@babel/plugin-syntax-jsx': 7.22.5(@babel/core@7.22.11) + '@babel/plugin-syntax-typescript': 7.22.5(@babel/core@7.22.11) + '@babel/types': 7.22.11 + '@jest/expect-utils': 29.6.4 + '@jest/transform': 29.6.4 + '@jest/types': 29.6.3 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.22.11) chalk: 4.1.2 - expect: 29.6.2 + expect: 29.6.4 graceful-fs: 4.2.11 - jest-diff: 29.6.2 - jest-get-type: 29.4.3 - jest-matcher-utils: 29.6.2 - jest-message-util: 29.6.2 - jest-util: 29.6.2 + jest-diff: 29.6.4 + jest-get-type: 29.6.3 + jest-matcher-utils: 29.6.4 + jest-message-util: 29.6.3 + jest-util: 29.6.3 natural-compare: 1.4.0 - pretty-format: 29.6.2 + pretty-format: 29.6.3 semver: 7.5.4 transitivePeerDependencies: - supports-color dev: true - /jest-util@29.6.2: - resolution: {integrity: sha512-3eX1qb6L88lJNCFlEADKOkjpXJQyZRiavX1INZ4tRnrBVr2COd3RgcTLyUiEXMNBlDU/cgYq6taUS0fExrWW4w==} + /jest-util@29.6.3: + resolution: {integrity: sha512-QUjna/xSy4B32fzcKTSz1w7YYzgiHrjjJjevdRf61HYk998R5vVMMNmrHESYZVDS5DSWs+1srPLPKxXPkeSDOA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.11 picomatch: 2.3.1 dev: true - /jest-validate@29.6.2: - resolution: {integrity: sha512-vGz0yMN5fUFRRbpJDPwxMpgSXW1LDKROHfBopAvDcmD6s+B/s8WJrwi+4bfH4SdInBA5C3P3BI19dBtKzx1Arg==} + /jest-validate@29.6.3: + resolution: {integrity: sha512-e7KWZcAIX+2W1o3cHfnqpGajdCs1jSM3DkXjGeLSNmCazv1EeI1ggTeK5wdZhF+7N+g44JI2Od3veojoaumlfg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.6.1 + '@jest/types': 29.6.3 camelcase: 6.3.0 chalk: 4.1.2 - jest-get-type: 29.4.3 + jest-get-type: 29.6.3 leven: 3.1.0 - pretty-format: 29.6.2 + pretty-format: 29.6.3 dev: true - /jest-watcher@29.6.2: - resolution: {integrity: sha512-GZitlqkMkhkefjfN/p3SJjrDaxPflqxEAv3/ik10OirZqJGYH5rPiIsgVcfof0Tdqg3shQGdEIxDBx+B4tuLzA==} + /jest-watcher@29.6.4: + resolution: {integrity: sha512-oqUWvx6+On04ShsT00Ir9T4/FvBeEh2M9PTubgITPxDa739p4hoQweWPRGyYeaojgT0xTpZKF0Y/rSY1UgMxvQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.6.2 - '@jest/types': 29.6.1 - '@types/node': 20.4.9 + '@jest/test-result': 29.6.4 + '@jest/types': 29.6.3 + '@types/node': 20.5.6 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 - jest-util: 29.6.2 + jest-util: 29.6.3 string-length: 4.0.2 dev: true - /jest-worker@29.6.2: - resolution: {integrity: sha512-l3ccBOabTdkng8I/ORCkADz4eSMKejTYv1vB/Z83UiubqhC1oQ5Li6dWCyqOIvSifGjUBxuvxvlm6KGK2DtuAQ==} + /jest-worker@29.6.4: + resolution: {integrity: sha512-6dpvFV4WjcWbDVGgHTWo/aupl8/LbBx2NSKfiwqf79xC/yeJjKHT1+StcKy/2KTmW16hE68ccKVOtXf+WZGz7Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 20.4.9 - jest-util: 29.6.2 + '@types/node': 20.5.6 + jest-util: 29.6.3 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest@29.6.2(@types/node@20.4.9)(ts-node@10.9.1): - resolution: {integrity: sha512-8eQg2mqFbaP7CwfsTpCxQ+sHzw1WuNWL5UUvjnWP4hx2riGz9fPSzYOaU5q8/GqWn1TfgZIVTqYJygbGbWAANg==} + /jest@29.6.4(@types/node@20.5.6)(ts-node@10.9.1): + resolution: {integrity: sha512-tEFhVQFF/bzoYV1YuGyzLPZ6vlPrdfvDmmAxudA1dLEuiztqg2Rkx20vkKY32xiDROcD2KXlgZ7Cu8RPeEHRKw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -1848,10 +1861,10 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.6.2(ts-node@10.9.1) - '@jest/types': 29.6.1 + '@jest/core': 29.6.4(ts-node@10.9.1) + '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.6.2(@types/node@20.4.9)(ts-node@10.9.1) + jest-cli: 29.6.4(@types/node@20.5.6)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -1985,8 +1998,8 @@ packages: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /node-fetch@2.6.12: - resolution: {integrity: sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==} + /node-fetch@2.7.0: + resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} peerDependencies: encoding: ^0.1.0 @@ -2106,11 +2119,11 @@ packages: find-up: 4.1.0 dev: true - /pretty-format@29.6.2: - resolution: {integrity: sha512-1q0oC8eRveTg5nnBEWMXAU2qpv65Gnuf2eCQzSjxpWFkPaPARwqZZDGuNE0zPAZfTCHzIk3A8dIjwlQKKLphyg==} + /pretty-format@29.6.3: + resolution: {integrity: sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.6.0 + '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.2.0 dev: true @@ -2317,7 +2330,7 @@ packages: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /ts-jest@29.1.1(@babel/core@7.22.10)(jest@29.6.2)(typescript@5.1.6): + /ts-jest@29.1.1(@babel/core@7.22.11)(jest@29.6.4)(typescript@5.2.2): resolution: {integrity: sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -2338,20 +2351,20 @@ packages: esbuild: optional: true dependencies: - '@babel/core': 7.22.10 + '@babel/core': 7.22.11 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.6.2(@types/node@20.4.9)(ts-node@10.9.1) - jest-util: 29.6.2 + jest: 29.6.4(@types/node@20.5.6)(ts-node@10.9.1) + jest-util: 29.6.3 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.5.4 - typescript: 5.1.6 + typescript: 5.2.2 yargs-parser: 21.1.1 dev: true - /ts-node@10.9.1(@types/node@20.4.9)(typescript@5.1.6): + /ts-node@10.9.1(@types/node@20.5.6)(typescript@5.2.2): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -2370,14 +2383,14 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.4.9 + '@types/node': 20.5.6 acorn: 8.10.0 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.1.6 + typescript: 5.2.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true @@ -2392,8 +2405,8 @@ packages: engines: {node: '>=10'} dev: true - /typescript@5.1.6: - resolution: {integrity: sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==} + /typescript@5.2.2: + resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} hasBin: true dev: true diff --git a/src/index.ts b/src/index.ts index 4f5c74f..fb0b350 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,10 @@ import { concatBytes } from "@noble/ciphers/utils"; + import { ephemeralKeySize, isEphemeralKeyCompressed } from "./config"; import { PrivateKey, PublicKey } from "./keys"; import { aesDecrypt, aesEncrypt, decodeHex, getValidSecret, remove0x } from "./utils"; -export function encrypt(receiverRawPK: string | Buffer, msg: Buffer): Buffer { +export function encrypt(receiverRawPK: string | Uint8Array, msg: Uint8Array): Buffer { const ephemeralKey = new PrivateKey(); const receiverPK = @@ -11,10 +12,10 @@ export function encrypt(receiverRawPK: string | Buffer, msg: Buffer): Buffer { ? new PublicKey(receiverRawPK) : PublicKey.fromHex(receiverRawPK); - const aesKey = ephemeralKey.encapsulate(receiverPK); - const encrypted = aesEncrypt(aesKey, msg); + const symKey = ephemeralKey.encapsulate(receiverPK); + const encrypted = aesEncrypt(symKey, msg); - let pk: Buffer; + let pk: Uint8Array; if (isEphemeralKeyCompressed()) { pk = ephemeralKey.publicKey.compressed; } else { @@ -23,17 +24,17 @@ export function encrypt(receiverRawPK: string | Buffer, msg: Buffer): Buffer { return Buffer.from(concatBytes(pk, encrypted)); } -export function decrypt(receiverRawSK: string | Buffer, msg: Buffer): Buffer { +export function decrypt(receiverRawSK: string | Uint8Array, msg: Uint8Array): Buffer { const receiverSK = receiverRawSK instanceof Uint8Array ? new PrivateKey(receiverRawSK) : PrivateKey.fromHex(receiverRawSK); const keySize = ephemeralKeySize(); - const senderPubkey = new PublicKey(msg.subarray(0, keySize)); + const senderPK = new PublicKey(msg.subarray(0, keySize)); const encrypted = msg.subarray(keySize); - const aesKey = senderPubkey.decapsulate(receiverSK); - return Buffer.from(aesDecrypt(aesKey, encrypted)); + const symKey = senderPK.decapsulate(receiverSK); + return Buffer.from(aesDecrypt(symKey, encrypted)); } export { ECIES_CONFIG } from "./config"; diff --git a/src/keys/PrivateKey.ts b/src/keys/PrivateKey.ts index ed327d9..5684073 100644 --- a/src/keys/PrivateKey.ts +++ b/src/keys/PrivateKey.ts @@ -1,3 +1,5 @@ +import { bytesToHex, equalBytes } from "@noble/ciphers/utils"; + import { isHkdfKeyCompressed } from "../config"; import { decodeHex, @@ -14,7 +16,7 @@ export default class PrivateKey { return new PrivateKey(decodeHex(hex)); } - public readonly secret: Buffer; + public readonly secret: Buffer; // TODO: Uint8Array public readonly publicKey: PublicKey; constructor(secret?: Uint8Array) { @@ -27,7 +29,7 @@ export default class PrivateKey { } public toHex(): string { - return this.secret.toString("hex"); + return bytesToHex(this.secret); } public encapsulate(pk: PublicKey): Uint8Array { @@ -43,11 +45,11 @@ export default class PrivateKey { return getSharedKey(senderPoint, sharedPoint); } - public multiply(pub: PublicKey, compressed: boolean = false): Uint8Array { - return getSharedPoint(this.secret, pub.compressed, compressed); + public multiply(pk: PublicKey, compressed: boolean = false): Uint8Array { + return getSharedPoint(this.secret, pk.compressed, compressed); } public equals(other: PrivateKey): boolean { - return this.secret.equals(other.secret); + return equalBytes(this.secret, other.secret); } } diff --git a/src/keys/PublicKey.ts b/src/keys/PublicKey.ts index 227d587..2cf46fd 100644 --- a/src/keys/PublicKey.ts +++ b/src/keys/PublicKey.ts @@ -1,3 +1,5 @@ +import { bytesToHex, equalBytes } from "@noble/ciphers/utils"; + import { isHkdfKeyCompressed } from "../config"; import { ETH_PUBLIC_KEY_SIZE, ONE } from "../consts"; import { decodeHex, getSharedKey, getSharedPoint } from "../utils"; @@ -16,7 +18,7 @@ export default class PublicKey { return new PublicKey(decoded); } - public readonly uncompressed: Buffer; + public readonly uncompressed: Buffer; // TODO: Uint8Array public readonly compressed: Buffer; constructor(buffer: Uint8Array) { @@ -26,9 +28,9 @@ export default class PublicKey { public toHex(compressed: boolean = true): string { if (compressed) { - return this.compressed.toString("hex"); + return bytesToHex(this.compressed); } else { - return this.uncompressed.toString("hex"); + return bytesToHex(this.uncompressed); } } @@ -46,6 +48,6 @@ export default class PublicKey { } public equals(other: PublicKey): boolean { - return this.uncompressed.equals(other.uncompressed); + return equalBytes(this.uncompressed, other.uncompressed); } } diff --git a/src/keys/index.ts b/src/keys/index.ts index 6425da3..b6b8014 100644 --- a/src/keys/index.ts +++ b/src/keys/index.ts @@ -1,2 +1,4 @@ +// treat Buffer as Uint8array, i.e. no call of Buffer specific functions +// finally Uint8Array only export { default as PrivateKey } from "./PrivateKey"; export { default as PublicKey } from "./PublicKey"; diff --git a/tests/crypt.test.ts b/tests/crypt.test.ts index 01f779c..b63b143 100644 --- a/tests/crypt.test.ts +++ b/tests/crypt.test.ts @@ -28,13 +28,13 @@ function checkHex(sk: PrivateKey) { describe("test encrypt and decrypt", () => { it("tests encrypt/decrypt", () => { - const prv1 = new PrivateKey(); - check(prv1); - checkHex(prv1); + const sk1 = new PrivateKey(); + check(sk1); + checkHex(sk1); - const prv2 = new PrivateKey(); - check(prv2, true); - checkHex(prv2); + const sk2 = new PrivateKey(); + check(sk2, true); + checkHex(sk2); }); it("tests known sk pk", () => { @@ -53,11 +53,11 @@ describe("test encrypt and decrypt", () => { ECIES_CONFIG.isHkdfKeyCompressed = true; ECIES_CONFIG.symmetricNonceLength = 12; - const prv1 = new PrivateKey(); - check(prv1); + const sk1 = new PrivateKey(); + check(sk1); - const prv2 = new PrivateKey(); - checkHex(prv2); + const sk2 = new PrivateKey(); + checkHex(sk2); ECIES_CONFIG.isEphemeralKeyCompressed = false; ECIES_CONFIG.isHkdfKeyCompressed = false; @@ -68,11 +68,11 @@ describe("test encrypt and decrypt", () => { ECIES_CONFIG.symmetricAlgorithm = "xchacha20"; ECIES_CONFIG.isEphemeralKeyCompressed = true; - const prv1 = new PrivateKey(); - check(prv1); + const sk1 = new PrivateKey(); + check(sk1); - const prv2 = new PrivateKey(); - checkHex(prv2); + const sk2 = new PrivateKey(); + checkHex(sk2); ECIES_CONFIG.symmetricAlgorithm = "aes-256-gcm"; ECIES_CONFIG.isEphemeralKeyCompressed = false; diff --git a/tests/integration.test.ts b/tests/integration.test.ts index 877e266..42713f3 100644 --- a/tests/integration.test.ts +++ b/tests/integration.test.ts @@ -1,5 +1,6 @@ import { HttpsProxyAgent } from "https-proxy-agent"; import fetch, { RequestInit } from "node-fetch"; + import { PrivateKey, decrypt, encrypt, utils } from "../src/index"; const decodeHex = utils.decodeHex; @@ -9,23 +10,21 @@ const TEXT = "helloworld🌍"; describe("test encrypt and decrypt", () => { it("tests encryption against python version", async () => { - const prv = new PrivateKey(); + const sk = new PrivateKey(); const res = await eciesApi(PYTHON_BACKEND, { data: TEXT, - pub: prv.publicKey.toHex(), + pub: sk.publicKey.toHex(), }); - const encryptedKnown = decodeHex(await res.text()); - const decrypted = decrypt(prv.toHex(), Buffer.from(encryptedKnown)); - + const decrypted = decrypt(sk.toHex(), decodeHex(await res.text())); expect(decrypted.toString()).toEqual(TEXT); }); it("tests decryption against python version", async () => { - const prv = new PrivateKey(); - const encrypted = encrypt(prv.publicKey.toHex(), Buffer.from(TEXT)); + const sk = new PrivateKey(); + const encrypted = encrypt(sk.publicKey.toHex(), Buffer.from(TEXT)); const res = await eciesApi(PYTHON_BACKEND, { data: encrypted.toString("hex"), - prv: prv.toHex(), + prv: sk.toHex(), }); expect(TEXT).toEqual(await res.text()); }); diff --git a/tests/keys.test.ts b/tests/keys.test.ts index b9dcc8c..fbfb394 100644 --- a/tests/keys.test.ts +++ b/tests/keys.test.ts @@ -31,13 +31,12 @@ describe("test keys", () => { }); it("tests equal", () => { - const prv = new PrivateKey(); - const pub = PublicKey.fromHex(prv.publicKey.toHex(false)); + const sk = new PrivateKey(); + const pk = PublicKey.fromHex(sk.publicKey.toHex(false)); - const isPubEqual = pub.uncompressed.equals(prv.publicKey.uncompressed); - expect(isPubEqual).toBe(true); + expect(pk.equals(sk.publicKey)).toBe(true); - const isFromHexWorking = prv.equals(PrivateKey.fromHex(prv.toHex())); + const isFromHexWorking = sk.equals(PrivateKey.fromHex(sk.toHex())); expect(isFromHexWorking).toBe(true); }); @@ -50,10 +49,10 @@ describe("test keys", () => { "a4e28911fcf83ab1f457a30b4959efc4b9306f514a4c3711a16a80e3b47eb58b" ); expect(ethPub).toEqual(ethPrv.publicKey); - expect(ethPub.compressed.toString("hex")).toEqual( + expect(ethPub.toHex(true)).toEqual( "0398afe4f150642cd05cc9d2fa36458ce0a58567daeaf5fde7333ba9b403011140" ); - expect(ethPub.uncompressed.toString("hex")).toEqual( + expect(ethPub.toHex(false)).toEqual( "0498afe4f150642cd05cc9d2fa36458ce0a58567daeaf5fde7333ba9b403011140" + "a4e28911fcf83ab1f457a30b4959efc4b9306f514a4c3711a16a80e3b47eb58b" ); diff --git a/tests/utils/compat.test.ts b/tests/utils/compat.test.ts index 47a7168..44043f7 100644 --- a/tests/utils/compat.test.ts +++ b/tests/utils/compat.test.ts @@ -1,7 +1,7 @@ +import { concatBytes } from "@noble/ciphers/utils"; import { aes_256_gcm as aes } from "@noble/ciphers/webcrypto/aes"; import { randomBytes } from "@noble/ciphers/webcrypto/utils"; -import { concatBytes } from "@noble/ciphers/utils"; import { decodeHex } from "../../src/utils"; import { aes256gcm } from "../../src/utils/compat";