@pezkuwi/x-bigint 14.0.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.
- package/README.md +3 -0
- package/package.json +26 -0
- package/src/index.ts +22 -0
- package/src/mod.ts +4 -0
- package/src/packageInfo.ts +6 -0
- package/src/shim.ts +7 -0
- package/tsconfig.build.json +14 -0
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"author": "Jaco Greeff <jacogr@gmail.com>",
|
|
3
|
+
"bugs": "https://github.com/pezkuwichain/pezkuwi-common/issues",
|
|
4
|
+
"description": "A cross-environment BigInt replacement",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=18"
|
|
7
|
+
},
|
|
8
|
+
"homepage": "https://github.com/pezkuwichain/pezkuwi-common/tree/master/packages/x-bigint#readme",
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"name": "@pezkuwi/x-bigint",
|
|
11
|
+
"repository": {
|
|
12
|
+
"directory": "packages/x-bigint",
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/pezkuwichain/pezkuwi-common.git"
|
|
15
|
+
},
|
|
16
|
+
"sideEffects": [
|
|
17
|
+
"./shim.js",
|
|
18
|
+
"./shim.cjs"
|
|
19
|
+
],
|
|
20
|
+
"type": "module",
|
|
21
|
+
"version": "14.0.1",
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@pezkuwi/x-global": "14.0.1",
|
|
24
|
+
"tslib": "^2.8.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Copyright 2017-2025 @polkadot/x-bigint authors & contributors
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
import { extractGlobal } from '@pezkuwi/x-global';
|
|
5
|
+
|
|
6
|
+
export { packageInfo } from './packageInfo.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*
|
|
11
|
+
* There are _still_ some older environments (specifically RN < 0.70), that does
|
|
12
|
+
* not have proper BigInt support - a non-working fallback is provided for those.
|
|
13
|
+
*
|
|
14
|
+
* We detect availability of BigInt upon usage, so this is purely to allow functional
|
|
15
|
+
* compilation & bundling. Since we have operators such as *+-/ top-level, a number-ish
|
|
16
|
+
* result is used here.
|
|
17
|
+
*/
|
|
18
|
+
function invalidFallback (): number {
|
|
19
|
+
return Number.NaN;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const BigInt = /*#__PURE__*/ extractGlobal('BigInt', invalidFallback);
|
package/src/mod.ts
ADDED
package/src/shim.ts
ADDED