UNPKG

@segment/analytics-core

Version:

This package represents core 'shared' functionality that is shared by analytics packages. This is not designed to be used directly, but internal to analytics-node and analytics-browser.

24 lines 761 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isPlainObject = exports.exists = exports.isFunction = exports.isNumber = exports.isString = void 0; function isString(obj) { return typeof obj === 'string'; } exports.isString = isString; function isNumber(obj) { return typeof obj === 'number'; } exports.isNumber = isNumber; function isFunction(obj) { return typeof obj === 'function'; } exports.isFunction = isFunction; function exists(val) { return val !== undefined && val !== null; } exports.exists = exists; function isPlainObject(obj) { return (Object.prototype.toString.call(obj).slice(8, -1).toLowerCase() === 'object'); } exports.isPlainObject = isPlainObject; //# sourceMappingURL=helpers.js.map