all files / src/ utility.js

100% Statements 16/16
100% Branches 4/4
100% Functions 3/3
100% Lines 6/6
1 branch Ignored     
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                            37×             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, '');
}