import getType from './typeof' ; function isString ( str ) { return getType ( str ) === 'string' ; } function isObject ( obj ) { return getType ( obj ) === 'object' ; } function isArray ( arr ) { return Array . isArray ( arr ) ; } function isFunction ( fn ) { const type = getType ( fn ) ; return type === 'function' || type === 'generatorfunction' ; } function deepMerge ( target , source ) { if ( isObject ( target ) && isObject ( source ) ) { Object . keys ( source ) . forEach ( ( key ) => { if ( isObject ( source [ key ] ) ) { if ( ! target [ key ] ) { Object . assign ( target , { [ key ] : { } } ) ; } deepMerge ( target [ key ] , source [ key ] ) ; } else { Object . assign ( target , { [ key ] : source [ key ] } ) ; } } ) ; } return target ; } export default { getType , isString , isObject , isArray , isFunction , deepMerge } ;