deno.land / std@0.224.0 / fs / _get_file_info_type.ts
123456789101112131415161718192021// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// Copyright the Browserify authors. MIT License.
export type PathType = "file" | "dir" | "symlink";
/** * Get a human readable file type string. * * @param fileInfo A FileInfo describes a file and is returned by `stat`, * `lstat` */export function getFileInfoType(fileInfo: Deno.FileInfo): PathType | undefined { return fileInfo.isFile ? "file" : fileInfo.isDirectory ? "dir" : fileInfo.isSymlink ? "symlink" : undefined;}
Version Info