mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
fix(ext/node): fs.mkdtemp
and fs.mkdtempSync
compatibility (#30602)
Some checks are pending
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Some checks are pending
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
`fs.mkdtemp` and `fs.mkdtempSync` now accept `Buffer` and `Uint8Array` path. The implementation has been moved to Rust, including directory suffix generation and directory creation.
This commit is contained in:
parent
71a74cb1c6
commit
e60f5d2c52
6 changed files with 264 additions and 97 deletions
|
@ -814,17 +814,20 @@ export const getValidatedPath = hideStackFrames(
|
|||
);
|
||||
|
||||
/**
|
||||
* @param {string | Buffer | URL} fileURLOrPath
|
||||
* @param {string | Buffer | Uint8Array | URL} fileURLOrPath
|
||||
* @param {string} [propName]
|
||||
* @returns string
|
||||
*/
|
||||
export const getValidatedPathToString = (fileURLOrPath, propName) => {
|
||||
const path = getValidatedPath(fileURLOrPath, propName);
|
||||
if (!Buffer.isBuffer(path)) {
|
||||
return path;
|
||||
if (isUint8Array(path)) {
|
||||
return new TextDecoder().decode(path);
|
||||
}
|
||||
// deno-lint-ignore prefer-primordials
|
||||
return path.toString();
|
||||
if (Buffer.isBuffer(path)) {
|
||||
// deno-lint-ignore prefer-primordials
|
||||
return path.toString();
|
||||
}
|
||||
return path;
|
||||
};
|
||||
|
||||
export const getValidatedFd = hideStackFrames((fd, propName = "fd") => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue