MCPcopy Create free account
hub / github.com/isomorphic-git/isomorphic-git / readdir

Method readdir

src/models/FileSystem.js:225–236  ·  view source on GitHub ↗

* Read a directory without throwing an error is the directory doesn't exist * * @param {string} filepath - The path to the directory. * @returns {Promise } - An array of file names, or `null` if the path is not a directory.

(filepath)

Source from the content-addressed store, hash-verified

223 * @returns {Promise<string[]|null>} - An array of file names, or `null` if the path is not a directory.
224 */
225 async readdir(filepath) {
226 try {
227 const names = await this._readdir(filepath)
228 // Ordering is not guaranteed, and system specific (Windows vs Unix)
229 // so we must sort them ourselves.
230 names.sort(compareStrings)
231 return names
232 } catch (err) {
233 if (err.code === 'ENOTDIR') return null
234 return []
235 }
236 }
237
238 /**
239 * Return a flat list of all the files nested inside a directory

Callers 15

rmRecursiveFunction · 0.45
unionWalkerFromReaddirFunction · 0.45
expandOidPackedFunction · 0.45
hasObjectPackedFunction · 0.45
expandOidLooseFunction · 0.45
readObjectPackedFunction · 0.45
addToIndexFunction · 0.45
test-branch.jsFile · 0.45
test-add.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected