MCPcopy Index your code
hub / github.com/codecombat/codecombat / prunePath

Function prunePath

app/core/deltas.js:232–240  ·  view source on GitHub ↗
(delta, path)

Source from the content-addressed store, hash-verified

230}
231
232const prunePath = function (delta, path) {
233 if (path.length === 1) {
234 if (delta[path] !== undefined) { return delete delta[path] }
235 } else {
236 if (delta[path[0]] !== undefined) { prunePath(delta[path[0]], path.slice(1)) }
237 const keys = (Array.from(_.keys(delta[path[0]])).filter((k) => k !== '_t'))
238 if (keys.length === 0) { return delete delta[path[0]] }
239 }
240}
241
242module.exports.DOC_SKIP_PATHS = [
243 '_id', 'version', 'commitMessage', 'parent', 'created',

Callers 1

deltas.jsFile · 0.85

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected