Skip to main content
Module

x/structurae/index.ts>BigBitFieldMixin

Data structures for high-performance JavaScript applications.
Latest
function BigBitFieldMixin
import { BigBitFieldMixin } from "https://deno.land/x/structurae@4.0.1/index.ts";

Creates a BigBitField class with a given schema. BigBitField uses bigints as bitfields to store and operate on data using bitwise operations.

Examples

const LargeField = BitFieldMixin({ width: 20, height: 20 }); const largeField = new LargeField({ width: 1048576, height: 1048576 }); largeField.value //=> 1099512676352n largeField.set('width', 1000).get('width') //=> 1000 largeField.toObject() //=> { width: 1000, height: 1048576 }

Type Parameters

T extends Record<K, number>
K extends keyof T

Parameters

schema: T

the schema

Returns

the BigBitFieldClass