UNPKG

@shuttle-lib/core

Version:

NPM package to interact with the Shuttle devices

20 lines 634 B
"use strict"; /* * This file contains internal convenience functions */ Object.defineProperty(exports, "__esModule", { value: true }); exports.literal = literal; exports.getBit = getBit; exports.uint8ArrayToDataView = uint8ArrayToDataView; /** Convenience function to force the input to be of a certain type. */ function literal(o) { return o; } /** Get bit value in integer */ function getBit(integer, bitPosition) { return (integer & (1 << bitPosition)) === 0 ? 0 : 1; } function uint8ArrayToDataView(buffer) { return new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength); } //# sourceMappingURL=lib.js.map