UNPKG

@tdb/web

Version:

Common condiguration for serving a web-site and testing web-based UI components.

14 lines (11 loc) 354 B
import cloneDeepWith from 'lodash/cloneDeepWith'; import isObject from 'lodash/isObject'; import isPlainObject from 'lodash/isPlainObject'; const safeClone = config => { return cloneDeepWith(config, value => { if (isObject(value) && (!isPlainObject(value) && !Array.isArray(value))) { return value; } }); }; export default safeClone;