Skip to main content

isFilePath

Callable


  • Returns true if a string or Path instance looks like a file system path, by checking for absolute or relative path markers, or the existence of path separating slashes. Will return false for values that are only the file or folder name.

    import { isFilePath } from '@boost/common';

    isFilePath('./path/to/file.ts'); // true
    isFilePath(new Path('/path/to/folder')); // true
    isFilePath('file.ts'); // false