MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / pathAt

Method pathAt

lib/utils/trace.js:273–279  ·  view source on GitHub ↗
(n, kind)

Source from the content-addressed store, hash-verified

271 // Path of the n-th file of `kind`, or null. Python-style indexing:
272 // 0..N-1 from the start, -1..-N from the end.
273 pathAt(n, kind) {
274 const files = this.list(kind)
275 if (!files.length) return null
276 const i = n < 0 ? files.length + n : n
277 if (i < 0 || i >= files.length) return null
278 return path.join(this.dir, files[i])
279 }
280
281 // Read content of the n-th file of `kind`. Binary kinds (screenshot) are
282 // returned as Buffer; text kinds as utf8 string.

Callers 1

nthMethod · 0.95

Calls 1

listMethod · 0.95

Tested by

no test coverage detected