|
1 | | -import fs, {promises as fsPromises} from 'fs'; |
| 1 | +import fs from 'node:fs'; |
| 2 | +import fsPromises from 'node:fs/promises'; |
2 | 3 |
|
3 | 4 | async function isType(fsStatType, statsMethodName, filePath) { |
4 | 5 | if (typeof filePath !== 'string') { |
@@ -33,9 +34,9 @@ function isTypeSync(fsStatType, statsMethodName, filePath) { |
33 | 34 | } |
34 | 35 | } |
35 | 36 |
|
36 | | -export const isFile = isType.bind(null, 'stat', 'isFile'); |
37 | | -export const isDirectory = isType.bind(null, 'stat', 'isDirectory'); |
38 | | -export const isSymlink = isType.bind(null, 'lstat', 'isSymbolicLink'); |
39 | | -export const isFileSync = isTypeSync.bind(null, 'statSync', 'isFile'); |
40 | | -export const isDirectorySync = isTypeSync.bind(null, 'statSync', 'isDirectory'); |
41 | | -export const isSymlinkSync = isTypeSync.bind(null, 'lstatSync', 'isSymbolicLink'); |
| 37 | +export const isFile = isType.bind(undefined, 'stat', 'isFile'); |
| 38 | +export const isDirectory = isType.bind(undefined, 'stat', 'isDirectory'); |
| 39 | +export const isSymlink = isType.bind(undefined, 'lstat', 'isSymbolicLink'); |
| 40 | +export const isFileSync = isTypeSync.bind(undefined, 'statSync', 'isFile'); |
| 41 | +export const isDirectorySync = isTypeSync.bind(undefined, 'statSync', 'isDirectory'); |
| 42 | +export const isSymlinkSync = isTypeSync.bind(undefined, 'lstatSync', 'isSymbolicLink'); |
0 commit comments