MCPcopy Create free account
hub / github.com/breck7/scroll / copyState

Function copyState

external/.scrollLibs.js:2261–2277  ·  view source on GitHub ↗
(mode, state)

Source from the content-addressed store, hash-verified

2259 }
2260
2261 function copyState(mode, state) {
2262 if (state === true) {
2263 return state
2264 }
2265 if (mode.copyState) {
2266 return mode.copyState(state)
2267 }
2268 var nstate = {}
2269 for (var n in state) {
2270 var val = state[n]
2271 if (val instanceof Array) {
2272 val = val.concat([])
2273 }
2274 nstate[n] = val
2275 }
2276 return nstate
2277 }
2278
2279 // Given a mode and a state (for that mode), find the inner mode and
2280 // state at the position that the state refers to.

Callers 4

.scrollLibs.jsFile · 0.85
getLineStylesFunction · 0.85
takeTokenFunction · 0.85
highlightWorkerFunction · 0.85

Calls 1

concatMethod · 0.80

Tested by

no test coverage detected