MCPcopy Index your code
hub / github.com/nodejs/node / #splitPath

Method #splitPath

lib/internal/vfs/providers/memory.js:242–247  ·  view source on GitHub ↗

* Splits a path into segments. * @param {string} path Normalized path * @returns {string[]} Path segments

(path)

Source from the content-addressed store, hash-verified

240 * @returns {string[]} Path segments
241 */
242 #splitPath(path) {
243 if (path === '/') {
244 return [];
245 }
246 return path.slice(1).split('/');
247 }
248
249
250 /**

Callers 3

#lookupEntryMethod · 0.95
#ensureParentMethod · 0.95
mkdirSyncMethod · 0.95

Calls 2

sliceMethod · 0.65
splitMethod · 0.45

Tested by

no test coverage detected