MCPcopy Index your code
hub / github.com/nodejs/node / join

Function join

lib/internal/fs/utils.js:229–250  ·  view source on GitHub ↗
(path, name)

Source from the content-addressed store, hash-verified

227const bufferSep = Buffer.from(pathModule.sep);
228
229function join(path, name) {
230 if ((typeof path === 'string' || isUint8Array(path)) &&
231 name === undefined) {
232 return path;
233 }
234
235 if (typeof path === 'string' && isUint8Array(name)) {
236 const pathBuffer = Buffer.from(pathModule.join(path, pathModule.sep));
237 return Buffer.concat([pathBuffer, name]);
238 }
239
240 if (typeof path === 'string' && typeof name === 'string') {
241 return pathModule.join(path, name);
242 }
243
244 if (isUint8Array(path) && isUint8Array(name)) {
245 return Buffer.concat([path, bufferSep, name]);
246 }
247
248 throw new ERR_INVALID_ARG_TYPE(
249 'path', ['string', 'Buffer'], path);
250}
251
252function getDirents(path, { 0: names, 1: types }, callback) {
253 let i;

Callers 15

globSyncMethod · 0.70
#addSubpatternsMethod · 0.70
#iterateSubpatternsMethod · 0.70
getDirentsFunction · 0.70
getDirentFunction · 0.70
enableCompileCacheFunction · 0.50
packageResolveFunction · 0.50
cleanupMethod · 0.50
setupCoverageFunction · 0.50
#rescanChildrenMethod · 0.50
#rescanRecursiveMethod · 0.50

Calls 4

isUint8ArrayFunction · 0.85
concatMethod · 0.80
fromMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…