@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 ADDED
@@ -0,0 +1,3 @@
1
+ # @pezkuwi/x-bigint
2
+
3
+ A cross-environment BigInt.
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
@@ -0,0 +1,4 @@
1
+ // Copyright 2017-2025 @polkadot/x-bigint authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export * from './index.js';
@@ -0,0 +1,6 @@
1
+ // Copyright 2017-2025 @polkadot/x-bigint authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ // Do not edit, auto-generated by @polkadot/dev
5
+
6
+ export const packageInfo = { name: '@polkadot/x-bigint', path: 'auto', type: 'auto', version: '14.0.1' };
package/src/shim.ts ADDED
@@ -0,0 +1,7 @@
1
+ // Copyright 2017-2025 @polkadot/x-bigint authors & contributors
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ import { BigInt } from '@pezkuwi/x-bigint';
5
+ import { exposeGlobal } from '@pezkuwi/x-global';
6
+
7
+ exposeGlobal('BigInt', BigInt);
@@ -0,0 +1,14 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "..",
5
+ "outDir": "./build",
6
+ "rootDir": "./src"
7
+ },
8
+ "exclude": [
9
+ "**/mod.ts"
10
+ ],
11
+ "references": [
12
+ { "path": "../x-global/tsconfig.build.json" }
13
+ ]
14
+ }