/** * 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;