information/node_modules/semver-parser/modules/common.js
2023-10-24 12:35:54 +02:00

23 lines
425 B
JavaScript

/**
* common.js
*/
/* constants */
const TYPE_FROM = 8;
const TYPE_TO = -1;
/**
* get type
* @param {*} o - object to check
* @returns {string} - type of object
*/
export const getType = o =>
Object.prototype.toString.call(o).slice(TYPE_FROM, TYPE_TO);
/**
* is string
* @param {*} o - object to check
* @returns {boolean} - result
*/
export const isString = o => typeof o === 'string' || o instanceof String;