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

Function copyState

lib/web/CodeMirror/src/modes.js:69–79  ·  view source on GitHub ↗
(mode, state)

Source from the content-addressed store, hash-verified

67}
68
69export function copyState(mode, state) {
70 if (state === true) return state
71 if (mode.copyState) return mode.copyState(state)
72 let nstate = {}
73 for (let n in state) {
74 let val = state[n]
75 if (val instanceof Array) val = val.concat([])
76 nstate[n] = val
77 }
78 return nstate
79}
80
81// Given a mode and a state (for that mode), find the inner mode and
82// state at the position that the state refers to.

Callers 5

highlightWorkerFunction · 0.90
fromSavedMethod · 0.90
saveMethod · 0.90
getLineStylesFunction · 0.90
takeTokenFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected