MCPcopy
hub / github.com/prettier/prettier / #getNodeStackIndex

Method #getNodeStackIndex

src/common/ast-path.js:111–119  ·  view source on GitHub ↗
(count)

Source from the content-addressed store, hash-verified

109 }
110
111 #getNodeStackIndex(count) {
112 const { stack } = this;
113 for (let i = stack.length - 1; i >= 0; i -= 2) {
114 if (!Array.isArray(stack[i]) && --count < 0) {
115 return i;
116 }
117 }
118 return -1;
119 }
120
121 // Temporarily push properties named by string arguments given after the
122 // callback function onto this.stack, then call the callback with a

Callers 2

getNodeMethod · 0.95
callParentMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected