@brimdata/zealot
Version:
The Javascript Client for Zed Lakes
44 lines (43 loc) • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
isObject: ()=>isObject,
isString: ()=>isString,
isDate: ()=>isDate,
isNumber: ()=>isNumber,
isBigInt: ()=>isBigInt,
isFracSec: ()=>isFracSec,
isTs: ()=>isTs
});
function hasOwnProperty(obj, prop) {
return Object.prototype.hasOwnProperty.call(obj, prop);
}
function isObject(thing) {
return typeof thing === "object" && thing !== null;
}
function isString(thing) {
return typeof thing === "string";
}
function isDate(thing) {
return isObject(thing) && thing.constructor.name === "Date";
}
function isNumber(thing) {
return typeof thing === "number";
}
function isBigInt(thing) {
return typeof thing === "bigint";
}
function isFracSec(thing) {
return isString(thing) && /^\d+\.\d+$/.test(thing);
}
function isTs(thing) {
return isObject(thing) && hasOwnProperty(thing, "sec") && isNumber(thing.sec) && hasOwnProperty(thing, "ns") && isNumber(thing.ns);
}