Add shims for x-* (not used, convenience) (#1282)

* Add shims for x-* (not used, convenience)

* Update packages/x-ws/src/shim.ts

* Remove (now) unused dependencies
This commit is contained in:
Jaco
2021-12-05 10:09:47 +02:00
committed by GitHub
parent 699ef952c3
commit 7436976598
9 changed files with 43 additions and 11 deletions
+4 -3
View File
@@ -8,11 +8,12 @@ Contributed:
Changes:
- Allow for use of `secp256k1` from `@polkadot/wasm-crypto`
- Adjust `isBigInt` to not do `instanceof` check
- Use `@polkadot/x-bigint` for `BigInt` constructor
- Split `@noble/hashes` fork into `x-noble-hashes` (w/ above `BigInt`)
- Add `@noble/hashes` fork as `x-noble-secp256k1` (w/ above `BigInt`), replaces `elliptic`
- Ensure consequtive capitals in `stringCamelCase` are lowercased
- Use `@polkadot/x-bigint` for `BigInt` constructor
- Split `@noble/hashes` fork into `x-noble-hashes`
- Add `@noble/secp256k1` fork into `x-noble-secp256k1`, replaces `elliptic`
## 8.0.5 Dec 1, 2021
+1 -2
View File
@@ -1,10 +1,9 @@
// Copyright 2017-2021 @polkadot/x-bigint authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { BigInt } from '@polkadot/x-bigint';
import { xglobal } from '@polkadot/x-global';
import { BigInt } from '.';
if (typeof xglobal.BigInt !== 'function') {
(xglobal as Record<string, unknown>).BigInt = BigInt;
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/x-fetch authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { fetch } from '@polkadot/x-fetch';
import { xglobal } from '@polkadot/x-global';
if (typeof xglobal.fetch !== 'function') {
(xglobal as Record<string, unknown>).fetch = fetch;
}
+1 -2
View File
@@ -22,7 +22,6 @@
"crypto": false
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@polkadot/x-bigint": "8.0.6-17"
"@babel/runtime": "^7.16.3"
}
}
+1 -2
View File
@@ -22,7 +22,6 @@
"crypto": false
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@polkadot/x-bigint": "8.0.6-17"
"@babel/runtime": "^7.16.3"
}
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/x-textdecoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { xglobal } from '@polkadot/x-global';
import { TextDecoder } from '@polkadot/x-textdecoder';
if (typeof xglobal.TextDecoder !== 'function') {
(xglobal as Record<string, unknown>).TextDecoder = TextDecoder;
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/x-textencoder authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { xglobal } from '@polkadot/x-global';
import { TextEncoder } from '@polkadot/x-textencoder';
if (typeof xglobal.TextEncoder !== 'function') {
(xglobal as Record<string, unknown>).TextEncoder = TextEncoder;
}
+9
View File
@@ -0,0 +1,9 @@
// Copyright 2017-2021 @polkadot/x-ws authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { xglobal } from '@polkadot/x-global';
import { WebSocket } from '@polkadot/x-ws';
if (typeof xglobal.WebSocket !== 'function') {
(xglobal as Record<string, unknown>).WebSocket = WebSocket;
}
-2
View File
@@ -2205,7 +2205,6 @@ __metadata:
resolution: "@polkadot/x-noble-hashes@workspace:packages/x-noble-hashes"
dependencies:
"@babel/runtime": ^7.16.3
"@polkadot/x-bigint": 8.0.6-17
languageName: unknown
linkType: soft
@@ -2214,7 +2213,6 @@ __metadata:
resolution: "@polkadot/x-noble-secp256k1@workspace:packages/x-noble-secp256k1"
dependencies:
"@babel/runtime": ^7.16.3
"@polkadot/x-bigint": 8.0.6-17
languageName: unknown
linkType: soft