deno.land / std@0.224.0 / fs / _get_file_info_type.ts

_get_file_info_type.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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;}
std

Version Info

Tagged at
3 weeks ago