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

Function encodeRealpathResult

lib/fs.js:3199–3207  ·  view source on GitHub ↗
(result, options)

Source from the content-addressed store, hash-verified

3197}
3198
3199function encodeRealpathResult(result, options) {
3200 if (!options || !options.encoding || options.encoding === 'utf8')
3201 return result;
3202 const asBuffer = Buffer.from(result);
3203 if (options.encoding === 'buffer') {
3204 return asBuffer;
3205 }
3206 return asBuffer.toString(options.encoding);
3207}
3208
3209// Finds the next portion of a (partial) path, up to the next path delimiter
3210let nextPart;

Callers 2

realpathSyncFunction · 0.85
LOOPFunction · 0.85

Calls 2

fromMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…