diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index c9e9c840de3b70..df5cfab361b114 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -1179,15 +1179,8 @@ async function mkdtemp(prefix, options) { prefix = getValidatedPath(prefix, 'prefix'); warnOnNonPortableTemplate(prefix); - let path; - if (typeof prefix === 'string') { - path = `${prefix}XXXXXX`; - } else { - path = Buffer.concat([prefix, Buffer.from('XXXXXX')]); - } - return await PromisePrototypeThen( - binding.mkdtemp(path, options.encoding, kUsePromises), + binding.mkdtemp(prefix, options.encoding, kUsePromises), undefined, handleErrorFromBinding, );