mirror of
https://github.com/denoland/deno.git
synced 2024-11-14 16:33:45 -05:00
18 lines
491 B
TypeScript
18 lines
491 B
TypeScript
// 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
|
|
);
|
|
}
|