File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ const { Buffer } = require('buffer');
29
29
const {
30
30
codes : {
31
31
ERR_FS_FILE_TOO_LARGE ,
32
- ERR_INVALID_ARG_TYPE ,
33
32
ERR_INVALID_ARG_VALUE ,
34
33
ERR_METHOD_NOT_IMPLEMENTED ,
35
34
} ,
@@ -74,6 +73,7 @@ const {
74
73
validateBuffer,
75
74
validateEncoding,
76
75
validateInteger,
76
+ validateString,
77
77
} = require ( 'internal/validators' ) ;
78
78
const pathModule = require ( 'path' ) ;
79
79
const { promisify } = require ( 'internal/util' ) ;
@@ -708,9 +708,8 @@ async function realpath(path, options) {
708
708
709
709
async function mkdtemp ( prefix , options ) {
710
710
options = getOptions ( options , { } ) ;
711
- if ( ! prefix || typeof prefix !== 'string' ) {
712
- throw new ERR_INVALID_ARG_TYPE ( 'prefix' , 'string' , prefix ) ;
713
- }
711
+
712
+ validateString ( prefix , 'prefix' ) ;
714
713
nullCheck ( prefix ) ;
715
714
warnOnNonPortableTemplate ( prefix ) ;
716
715
return binding . mkdtemp ( `${ prefix } XXXXXX` , options . encoding , kUsePromises ) ;
You can’t perform that action at this time.
0 commit comments