Path type validators.
Whether a path points to a file.
import { isFile } from '@cc-heart/utils-service' await isFile('./package.json') // true await isFile('./src') // false
Whether a path points to a directory.
import { isDirectory } from '@cc-heart/utils-service' await isDirectory('./src') // true
import { isFile, isDirectory } from '@cc-heart/utils-service' async function describe(path: string) { if (await isFile(path)) return 'file' if (await isDirectory(path)) return 'directory' return 'missing' }