mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
BREAKING CHANGE: remove Deno.OpenMode (#4884)
This commit removes Deno.OpenMode along with overloaded variants of Deno.open() and Deno.openSync() that used OpenMode.
This commit is contained in:
parent
0cb1bb98cc
commit
4a8d25646a
14 changed files with 113 additions and 198 deletions
|
@ -24,8 +24,10 @@ export function writeFileSync(
|
|||
}
|
||||
}
|
||||
|
||||
const openMode = !!options.append ? "a" : "w";
|
||||
const file = openSync(path, openMode);
|
||||
const openOptions = !!options.append
|
||||
? { write: true, create: true, append: true }
|
||||
: { write: true, create: true, truncate: true };
|
||||
const file = openSync(path, openOptions);
|
||||
|
||||
if (
|
||||
options.mode !== undefined &&
|
||||
|
@ -52,8 +54,10 @@ export async function writeFile(
|
|||
}
|
||||
}
|
||||
|
||||
const openMode = !!options.append ? "a" : "w";
|
||||
const file = await open(path, openMode);
|
||||
const openOptions = !!options.append
|
||||
? { write: true, create: true, append: true }
|
||||
: { write: true, create: true, truncate: true };
|
||||
const file = await open(path, openOptions);
|
||||
|
||||
if (
|
||||
options.mode !== undefined &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue