diff options
author | Chris Knight <cknight1234@gmail.com> | 2020-03-08 23:14:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-08 19:14:53 -0400 |
commit | 1b6fc87b7188118896f797e5f0dab309775def71 (patch) | |
tree | 2c4baf50d749b080731bb6b759745626b567b769 /std/node/_fs/_fs_common.ts | |
parent | 6f0b70eb1e0061a0033d89a916075d27023c57a8 (diff) |
feat(std/node) add appendFile and appendFileSync (#4294)
Diffstat (limited to 'std/node/_fs/_fs_common.ts')
-rw-r--r-- | std/node/_fs/_fs_common.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/std/node/_fs/_fs_common.ts b/std/node/_fs/_fs_common.ts new file mode 100644 index 000000000..4de0899ea --- /dev/null +++ b/std/node/_fs/_fs_common.ts @@ -0,0 +1,18 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +export interface FileOptions { + encoding?: string; + mode?: number; + flag?: string; +} + +export function isFileOptions( + fileOptions: string | FileOptions | undefined +): fileOptions is FileOptions { + if (!fileOptions) return false; + + return ( + (fileOptions as FileOptions).encoding != undefined || + (fileOptions as FileOptions).flag != undefined || + (fileOptions as FileOptions).mode != undefined + ); +} |