MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / copyObj

Function copyObj

lib/web/CodeMirror/src/util/misc.js:6–12  ·  view source on GitHub ↗
(obj, target, overwrite)

Source from the content-addressed store, hash-verified

4}
5
6export function copyObj(obj, target, overwrite) {
7 if (!target) target = {}
8 for (let prop in obj)
9 if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
10 target[prop] = obj[prop]
11 return target
12}
13
14// Counts the column offset in a string, taking tabs into account.
15// Used mostly to find indentation.

Callers 6

extendModeFunction · 0.90
markTextFunction · 0.90
markTextSharedFunction · 0.90
fromTextAreaFunction · 0.90
CodeMirrorFunction · 0.90
createObjFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected