UNPKG

@brimdata/zealot

Version:

The Javascript Client for Zed Lakes

46 lines (45 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "Uint64", { enumerable: true, get: ()=>Uint64 }); const _isNull = require("../utils/is-null"); const _typeUint64 = require("../types/type-uint64"); const _primitive = require("./primitive"); function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } class Uint64 extends _primitive.Primitive { toInt() { if ((0, _isNull.isNull)(this.value)) return null; return parseInt(this.value); } toBigInt() { if ((0, _isNull.isNull)(this.value)) return null; return BigInt(this.value); } toJS(opts = {}) { if (opts.bigint) { return this.toBigInt(); } else { return this.toInt(); } } constructor(...args){ super(...args); _defineProperty(this, "type", _typeUint64.TypeUint64); } }