core3-utils

@wixc3/fs-utils on Github

Home > @wixc3/fs-utils > isPathIncludesDir

isPathIncludesDir() function

Safely checks if a path contains a directory name.

Signature:

export declare function isPathIncludesDir(filePath: string, directoryName: string): boolean;

Parameters

Parameter Type Description
filePath string absolute path to a file
directoryName string directory to check if included as dir inside the file path

Returns:

boolean

boolean indicating if filePath includes directoryName