Skip to content

Commit

Permalink
fs: use missing validator for fsPromises
Browse files Browse the repository at this point in the history
  • Loading branch information
VoltrexKeyva committed Jun 14, 2021
1 parent c8634ed commit 3acb547
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/internal/fs/promises.js
Expand Up @@ -29,7 +29,6 @@ const { Buffer } = require('buffer');
const {
codes: {
ERR_FS_FILE_TOO_LARGE,
ERR_INVALID_ARG_TYPE,
ERR_INVALID_ARG_VALUE,
ERR_METHOD_NOT_IMPLEMENTED,
},
Expand Down Expand Up @@ -74,6 +73,7 @@ const {
validateBuffer,
validateEncoding,
validateInteger,
validateString,
} = require('internal/validators');
const pathModule = require('path');
const { promisify } = require('internal/util');
Expand Down Expand Up @@ -708,9 +708,8 @@ async function realpath(path, options) {

async function mkdtemp(prefix, options) {
options = getOptions(options, {});
if (!prefix || typeof prefix !== 'string') {
throw new ERR_INVALID_ARG_TYPE('prefix', 'string', prefix);
}

validateString(prefix, 'prefix');
nullCheck(prefix);
warnOnNonPortableTemplate(prefix);
return binding.mkdtemp(`${prefix}XXXXXX`, options.encoding, kUsePromises);
Expand Down

0 comments on commit 3acb547

Please sign in to comment.