UNPKG

1.22 kBTypeScriptView Raw
1export type PathTypeFunction = (path: string) => Promise<boolean>;
2
3/**
4Check whether the passed `path` is a file.
5
6@param path - The path to check.
7@returns Whether the `path` is a file.
8*/
9export const isFile: PathTypeFunction;
10
11/**
12Check whether the passed `path` is a directory.
13
14@param path - The path to check.
15@returns Whether the `path` is a directory.
16*/
17export const isDirectory: PathTypeFunction;
18
19/**
20Check whether the passed `path` is a symlink.
21
22@param path - The path to check.
23@returns Whether the `path` is a symlink.
24*/
25export const isSymlink: PathTypeFunction;
26
27export type PathTypeSyncFunction = (path: string) => boolean;
28
29/**
30Synchronously check whether the passed `path` is a file.
31
32@param path - The path to check.
33@returns Whether the `path` is a file.
34*/
35export const isFileSync: PathTypeSyncFunction;
36
37/**
38Synchronously check whether the passed `path` is a directory.
39
40@param path - The path to check.
41@returns Whether the `path` is a directory.
42*/
43export const isDirectorySync: PathTypeSyncFunction;
44
45/**
46Synchronously check whether the passed `path` is a symlink.
47
48@param path - The path to check.
49@returns Whether the `path` is a directory.
50*/
51export const isSymlinkSync: PathTypeSyncFunction;