MCPcopy Create free account
hub / github.com/codecombat/codecombat / filterDeltas

Method filterDeltas

app/views/editor/DeltaView.js:92–111  ·  view source on GitHub ↗
(deltas)

Source from the content-addressed store, hash-verified

90 }
91
92 filterDeltas (deltas) {
93 if (!this.skipPaths) { return [deltas, []] }
94 for (let i = 0; i < this.skipPaths.length; i++) {
95 const path = this.skipPaths[i]
96 if (_.isString(path)) { this.skipPaths[i] = [path] }
97 }
98 const newDeltas = []
99 const skippedDeltas = []
100 for (const delta of Array.from(deltas)) {
101 let skip = false
102 for (const skipPath of Array.from(this.skipPaths)) {
103 if (_.isEqual(_.first(delta.dataPath, skipPath.length), skipPath)) {
104 skip = true
105 break
106 }
107 }
108 if (skip) { skippedDeltas.push(delta) } else { newDeltas.push(delta) }
109 }
110 return [newDeltas, skippedDeltas]
111 }
112
113 afterRender () {
114 let deltaData, deltaEl, i

Callers 1

buildDeltasMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected