Add BigInt shim (#1280)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
// Copyright 2017-2021 @polkadot/util-crypto authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import '@polkadot/x-bigint/shim';
|
||||
|
||||
import { u8aConcat } from '@polkadot/util';
|
||||
import { utils as utilsNobleSecp256k1 } from '@polkadot/x-noble-secp256k1';
|
||||
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/polkadot-js/common.git"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"sideEffects": [
|
||||
"./shim.js",
|
||||
"./shim.cjs"
|
||||
],
|
||||
"type": "module",
|
||||
"version": "8.0.6-15",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2021 @polkadot/x-ws authors & contributors
|
||||
// Copyright 2017-2021 @polkadot/x-bigint authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { xglobal } from '@polkadot/x-global';
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
// Copyright 2017-2021 @polkadot/x-bigint authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { xglobal } from '@polkadot/x-global';
|
||||
|
||||
import { BigInt } from '.';
|
||||
|
||||
if (typeof xglobal.BigInt !== 'function') {
|
||||
(xglobal as Record<string, unknown>).BigInt = BigInt;
|
||||
}
|
||||
Reference in New Issue
Block a user