0.0.23 • Published 1 year ago

@yume-chan/dataview-bigint-polyfill v0.0.23

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@yume-chan/dataview-bigint-polyfill

Polyfill for DataView#getBigInt64, DataView#getBigUint64, DataView#setBigInt64 and DataView#setBigUint64.

Requires native BigInt support.

Flavors

It ships with 3 flavors:

Pure: provide alternative implementations.

import { getBigInt64, getBigUint64, setBigInt64, setBigUint64 } from '@yume-chan/dataview-bigint-polyfill';

getBigInt64(dataView, byteOffset, littleEndian);
getBigUint64(dataView, byteOffset, littleEndian);
setBigInt64(dataView, byteOffset, value, littleEndian);
setBigUint64(dataView, byteOffset, value, littleEndian);

Fallback: use native implementations if available.

import { getBigInt64, getBigUint64, setBigInt64, setBigUint64 } from '@yume-chan/dataview-bigint-polyfill/esm/fallback';

getBigInt64(dataView, byteOffset, littleEndian);
getBigUint64(dataView, byteOffset, littleEndian);
setBigInt64(dataView, byteOffset, value, littleEndian);
setBigUint64(dataView, byteOffset, value, littleEndian);

Polyfill: patch DataView.prototype when native support is not available.

import '@yume-chan/dataview-bigint-polyfill/esm/polyfill.js';

dataView.getBigInt64(byteOffset, littleEndian);
dataView.getBigUint64(byteOffset, littleEndian);
dataView.setBigInt64(byteOffset, value, littleEndian);
dataView.setBigUint64(byteOffset, value, littleEndian);
0.0.23

1 year ago

0.0.22

2 years ago

0.0.21

2 years ago

0.0.20

2 years ago

0.0.19

2 years ago

0.0.18

2 years ago

0.0.17

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.10

3 years ago