Skip to content

Commit 93e0a32

Browse files
committed
fix: code
1 parent 841ee6c commit 93e0a32

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/internal/fs/utils.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ function join(path, name) {
229229
return Buffer.concat([pathBuffer, name]);
230230
}
231231

232+
if (isUint8Array(path) && typeof name === 'string') {
233+
const nameBuffer = Buffer.from(name);
234+
return Buffer.concat([path, bufferSep, nameBuffer]);
235+
}
236+
232237
if (typeof path === 'string' && typeof name === 'string') {
233238
return pathModule.join(path, name);
234239
}
@@ -250,6 +255,12 @@ function relative(from, to) {
250255
return Buffer.from(pathModule.relative(Buffer.from(from), to));
251256
}
252257

258+
if (isUint8Array(from) && isUint8Array(to)) {
259+
const fromPath = Buffer.from(from);
260+
const toPath = Buffer.from(to);
261+
return pathModule.relative(fromPath.toString(), toPath.toString());
262+
}
263+
253264
if (typeof from === 'string' && typeof to === 'string') {
254265
return pathModule.relative(from, to);
255266
}

0 commit comments

Comments
 (0)