File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ const { Buffer } = require('buffer');
2929const {
3030 codes : {
3131 ERR_FS_FILE_TOO_LARGE ,
32- ERR_INVALID_ARG_TYPE ,
3332 ERR_INVALID_ARG_VALUE ,
3433 ERR_METHOD_NOT_IMPLEMENTED ,
3534 } ,
@@ -74,6 +73,7 @@ const {
7473 validateBuffer,
7574 validateEncoding,
7675 validateInteger,
76+ validateString,
7777} = require ( 'internal/validators' ) ;
7878const pathModule = require ( 'path' ) ;
7979const { promisify } = require ( 'internal/util' ) ;
@@ -708,9 +708,8 @@ async function realpath(path, options) {
708708
709709async function mkdtemp ( prefix , options ) {
710710 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' ) ;
714713 nullCheck ( prefix ) ;
715714 warnOnNonPortableTemplate ( prefix ) ;
716715 return binding . mkdtemp ( `${ prefix } XXXXXX` , options . encoding , kUsePromises ) ;
You can’t perform that action at this time.
0 commit comments