MCPcopy
hub / github.com/orestbida/cookieconsent / deepCopy

Function deepCopy

playground/src/modules/utils.js:5–21  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

3 * @param {any} el
4 */
5export const deepCopy = (el) => {
6 if (typeof el !== 'object' )
7 return el;
8
9 if (el instanceof Date)
10 return new Date(el.getTime());
11
12 let clone = Array.isArray(el) ? [] : {};
13
14 for (let key in el) {
15 let value = el[key];
16
17 clone[key] = deepCopy(value);
18 }
19
20 return clone;
21};
22
23export const customEvents = {
24 _PLAYGROUND_READY: 'pg:ready',

Callers 2

getStateFunction · 0.90
getCurrentUserConfigFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…