1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | 1× 1× 37× 1× 40× | import isArray from 'lodash.isarray'; import isFunction from 'lodash.isfunction'; import isString from 'lodash.isstring'; const check = { 'array': isArray, 'function': isFunction, 'string': isString, }; /** * @param {string} type * @param {*} value * @return {boolean} */ export function is(type, value) { return check[type](value); } /** * @param {string} str * @return {string} */ export function removeQuotes(str) { return str.replace(/^["']|["']$/g, ''); } |