UNPKG

@webkrafters/long-count

Version:

Long Count - intervals and timeout capable of handling superbly long wait times surviving device sleep and wake cycles.

20 lines (19 loc) 636 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTypeOf = void 0; exports.getTypeOfMyInteger = getTypeOfMyInteger; exports.noop = void 0; var FROM_STRING_PATTERN = /\s(\w+)\]$/; var MY_INTEGER_PATTERN = /(?:^Number$)|(?:^Uint8Array$)/; var toString = Object.prototype.toString; var getTypeOf = exports.getTypeOf = function getTypeOf(value) { return toString.call(value).match(FROM_STRING_PATTERN)[1]; }; function getTypeOfMyInteger(value) { var typeName = getTypeOf(value); return MY_INTEGER_PATTERN.test(typeName) ? typeName : 'Invalid'; } ; var noop = exports.noop = function noop() {};