@@ -3571,7 +3571,9 @@ function mkdtemp(prefix, options, callback) {
35713571 if ( h !== null && vfsResult ( h . mkdtemp ( prefix , typeof options === 'function' ? undefined : options ) , callback ) ) return ;
35723572
35733573 options = getOptions ( options ) ;
3574-
3574+ if ( BufferIsBuffer ( prefix ) ) {
3575+ options = { ...options , encoding : 'buffer' } ;
3576+ }
35753577 prefix = getValidatedPath ( prefix , 'prefix' ) ;
35763578 warnOnNonPortableTemplate ( prefix ) ;
35773579
@@ -3594,7 +3596,9 @@ function mkdtempSync(prefix, options) {
35943596 }
35953597
35963598 options = getOptions ( options ) ;
3597-
3599+ if ( BufferIsBuffer ( prefix ) ) {
3600+ options = { ...options , encoding : 'buffer' } ;
3601+ }
35983602 prefix = getValidatedPath ( prefix , 'prefix' ) ;
35993603 warnOnNonPortableTemplate ( prefix ) ;
36003604 return binding . mkdtemp ( prefix , options . encoding ) ;
@@ -3610,7 +3614,9 @@ function mkdtempSync(prefix, options) {
36103614 */
36113615function mkdtempDisposableSync ( prefix , options ) {
36123616 options = getOptions ( options ) ;
3613-
3617+ if ( BufferIsBuffer ( prefix ) ) {
3618+ options = { ...options , encoding : 'buffer' } ;
3619+ }
36143620 prefix = getValidatedPath ( prefix , 'prefix' ) ;
36153621 warnOnNonPortableTemplate ( prefix ) ;
36163622
0 commit comments