2020-03-08 19:14:53 -04:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-03-12 10:12:27 -04:00
|
|
|
|
|
|
|
export type CallbackWithError = (err?: Error) => void;
|
|
|
|
|
2020-03-08 19:14:53 -04:00
|
|
|
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
|
|
|
|
);
|
|
|
|
}
|