File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments