Skip to content
Myr

fix specs

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Andrey Boldyrev · committed by Andrey Boldyrev · parent 741e941 · Browse files · 2 files+10 added−9 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+10 added−9 removed

  • other:+10 added−9 removed

2 files+10 added−9 removed

modified:src/common.js+2 added
219 unmodified lines
220221export function clone(obj) {222 if (!isDraftable(obj)) return obj223 if (Array.isArray(obj)) return obj.map(clone)224 if (isMap(obj)) return new Map(obj)225 if (isSet(obj)) return new Set(obj)226 const cloned = Object.create(Object.getPrototypeOf(obj))227 for (const key in obj) cloned[key] = clone(obj[key])228 return cloned229}
7 unmodified lines
modified:src/patches.js+8 added-9 removed