Lines Matching refs:path

61 const pathModule = require('path');
164 constructor(name, type, path, filepath = path && join(path, name)) {
166 this.parentPath = path;
167 this.path = filepath;
201 constructor(name, stats, path, filepath) {
202 super(name, null, path, filepath);
225 function join(path, name) {
226 if ((typeof path === 'string' || isUint8Array(path)) &&
228 return path;
231 if (typeof path === 'string' && isUint8Array(name)) {
232 const pathBuffer = Buffer.from(pathModule.join(path, pathModule.sep));
236 if (typeof path === 'string' && typeof name === 'string') {
237 return pathModule.join(path, name);
240 if (isUint8Array(path) && isUint8Array(name)) {
241 return Buffer.concat([path, bufferSep, name]);
245 'path', ['string', 'Buffer'], path);
248 function getDirents(path, { 0: names, 1: types }, callback) {
262 filepath = join(path, name);
272 names[idx] = new DirentFromStats(name, stats, path, filepath);
278 names[i] = new Dirent(names[i], types[i], path);
287 names[i] = getDirent(path, names[i], types[i]);
293 function getDirent(path, name, type, callback) {
298 filepath = join(path, name);
308 callback(null, new DirentFromStats(name, stats, path, filepath));
311 callback(null, new Dirent(name, type, path));
314 const filepath = join(path, name);
317 return new DirentFromStats(name, stats, path, callback === true ? filepath : path);
320 return new Dirent(name, type, path);
322 return new Dirent(name, type, path, path);
367 // Check if the path contains null types if it is a string nor Uint8Array,
369 const nullCheck = hideStackFrames((path, propName, throwError = true) => {
370 const pathIsString = typeof path === 'string';
371 const pathIsUint8Array = isUint8Array(path);
375 (pathIsString && !StringPrototypeIncludes(path, '\u0000')) ||
376 (pathIsUint8Array && !TypedArrayPrototypeIncludes(path, 0))) {
382 path,
391 function preprocessSymlinkDestination(path, type, linkPath) {
394 return path;
396 path = '' + path;
400 path = pathModule.resolve(linkPath, '..', path);
401 return pathModule.toNamespacedPath(path);
403 if (pathModule.isAbsolute(path)) {
404 // If the path is absolute, use the \\?\-prefix to enable long filenames
405 return pathModule.toNamespacedPath(path);
408 return RegExpPrototypeSymbolReplace(/\//g, path, '\\');
700 const validatePath = hideStackFrames((path, propName = 'path') => {
701 if (typeof path !== 'string' && !isUint8Array(path)) {
702 throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
705 const err = nullCheck(path, propName, false);
712 const getValidatedPath = hideStackFrames((fileURLOrPath, propName = 'path') => {
713 const path = toPathIfFileURL(fileURLOrPath);
714 validatePath(path, propName);
715 return path;
798 const validateRmOptions = hideStackFrames((path, options, expectDir, cb) => {
802 lazyLoadFs().lstat(path, (err, stats) => {
818 path,
827 const validateRmOptionsSync = hideStackFrames((path, options, expectDir) => {
833 .lstatSync(path, { throwIfNoEntry: !options.force })?.isDirectory();
843 path,
857 'In future versions of Node.js, fs.rmdir(path, { recursive: true }) ' +
858 'will be removed. Use fs.rm(path, { recursive: true }) instead',