1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
denoland-deno/std/node/_fs/_fs_common.ts

22 lines
548 B
TypeScript
Raw Normal View History

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
export type CallbackWithError = (err?: Error) => void;
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
);
}