MCPcopy
hub / github.com/webpack/webpack / dirname

Function dirname

lib/util/fs.js:578–589  ·  view source on GitHub ↗
(fs, absPath)

Source from the content-addressed store, hash-verified

576 * @returns {string} the parent directory of the absolute path
577 */
578const dirname = (fs, absPath) => {
579 if (fs && fs.dirname) {
580 return fs.dirname(absPath);
581 } else if (path.posix.isAbsolute(absPath)) {
582 return path.posix.dirname(absPath);
583 } else if (path.win32.isAbsolute(absPath)) {
584 return path.win32.dirname(absPath);
585 }
586 throw new Error(
587 `${absPath} is neither a posix nor a windows path, and there is no 'dirname' method defined in the file system`
588 );
589};
590
591/**
592 * Processes the provided f.

Callers 15

_getManagedItemInfoMethod · 0.85
applyMethod · 0.85
applyMethod · 0.85
emitFilesMethod · 0.85
_emitRecordsMethod · 0.85
serializeMethod · 0.85
tryLoadCurrentFunction · 0.85
applyMethod · 0.85
createTraceFunction · 0.85
mkdirpFunction · 0.85
mkdirpSyncFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected