import assignWith from 'lodash/assignWith' ; import isUndefined from 'lodash/isUndefined' ; import isArray from 'lodash/isArray' ; function withDefined ( dest , src ) { return isUndefined ( src ) ? dest : src ; } export function assignWithDefined ( ... args ) { return assignWith ( ... args , withDefined ) ; } export function toArray < T > ( value ? ) { if ( value === undefined || value === null ) { return [ ] ; } return isArray ( value ) ? value : [ value ] ; }