MCPcopy
hub / github.com/loggerhead/json4u / onObjectBegin

Method onObjectBegin

src/lib/parser/parse.ts:213–227  ·  view source on GitHub ↗
(offset: number, type: NodeType, pathSupplier: () => jsonc.JSONPath)

Source from the content-addressed store, hash-verified

211 }
212
213 onObjectBegin(offset: number, type: NodeType, pathSupplier: () => jsonc.JSONPath) {
214 if (this.parseErrors.length > 0) {
215 return false;
216 }
217
218 const path = this.genPath(pathSupplier);
219 const node = this.newNode(path, type, offset);
220
221 if (this.currentParent) {
222 this.addChild(node);
223 }
224
225 this.currentParent = node;
226 return true;
227 }
228
229 onObjectEnd(offset: number, length: number) {
230 const parent = this.currentParent;

Callers 2

onObjectBeginFunction · 0.80
onArrayBeginFunction · 0.80

Calls 3

genPathMethod · 0.95
newNodeMethod · 0.95
addChildMethod · 0.95

Tested by

no test coverage detected