d2-ui
Version:
20 lines (17 loc) • 685 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isPrimitive;
function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
/**
* Check if a value is a _primitive_ (string, number, boolean)
*
* @param {*} param Value to be checked for a primitive type definition.
* @returns {boolean} Returns `true` if the value is a primitive, otherwise `false`
*/
function isPrimitive(param) {
var type = typeof param === 'undefined' ? 'undefined' : _typeof(param);
return type === 'string' || type === 'number' || type === 'boolean';
}
//# sourceMappingURL=isPrimitive.js.map