Skip to content
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.

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

License

Notifications You must be signed in to change notification settings

yume-chan/dataview-bigint-polyfill

Repository files navigation

@yume-chan/dataview-bigint-polyfill

Warning

This package has been deprecated since all modern browsers now natively support DataView#getBigInt64, DataView#getBigUint64, DataView#setBigInt64 and DataView#setBigUint64.

https://caniuse.com/?search=dataview%20bigint

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);

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published