UNPKG

@gmod/cram

Version:

read CRAM files with pure Javascript

22 lines 969 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const _base_ts_1 = __importDefault(require("./_base.js")); const getBits_ts_1 = require("./getBits.js"); const errors_ts_1 = require("../../errors.js"); class BetaCodec extends _base_ts_1.default { constructor(parameters, dataType) { super(parameters, dataType); if (this.dataType !== 'int') { throw new errors_ts_1.CramUnimplementedError(`${this.dataType} decoding not yet implemented by BETA codec`); } } decode(_slice, coreDataBlock, _blocksByContentId, cursors) { const fromBits = (0, getBits_ts_1.getBits)(coreDataBlock.content, cursors.coreBlock, this.parameters.length); return fromBits - this.parameters.offset; } } exports.default = BetaCodec; //# sourceMappingURL=beta.js.map