UNPKG

@procore/core-react

Version:
24 lines (22 loc) 814 B
/** @file es-toolkit mock */ module.exports = { isEqual: (a, b) => a === b, cloneDeep: (obj) => JSON.parse(JSON.stringify(obj)), merge: (target, ...sources) => Object.assign(target, ...sources), debounce: (func, wait) => func, throttle: (func, wait) => func, isEmpty: (value) => { if (value == null) return true if (Array.isArray(value) || typeof value === 'string') return value.length === 0 if (typeof value === 'object') return Object.keys(value).length === 0 return false }, isObject: (value) => value !== null && typeof value === 'object', isArray: Array.isArray, isString: (value) => typeof value === 'string', isNumber: (value) => typeof value === 'number', isFunction: (value) => typeof value === 'function', noop: () => {}, identity: (value) => value, }