MCPcopy Index your code
hub / github.com/nodejs/node / toJSON

Method toJSON

deps/minimatch/index.js:554–562  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

552 }
553 }
554 toJSON() {
555 const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
556 if (this.isStart() && !this.type)
557 ret.unshift([]);
558 if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
559 ret.push({});
560 }
561 return ret;
562 }
563 isStart() {
564 if (this.#root === this)
565 return true;

Callers

nothing calls this directly

Calls 6

isStartMethod · 0.80
unshiftMethod · 0.80
isEndMethod · 0.80
mapMethod · 0.65
sliceMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected