@mikeyt23/node-cli-utils
    Preparing search index...

    Function isChildPath

    • Check if child path is a file or subdirectory underneath the parentDir directory. The parentDir param must be a valid path and a directory. The child path does not need to exist, but note that if the child path is relative, it will be resolved using the current working directory. Transform or resolve the child path before passing into this method to avoid using current working directory.

      Parameters

      • parentDir: string

        An existing directory to check the child path against.

      • child: string

        An existing or non-existent path to check against the parentDir path.

      • requireChildExists: boolean = false

        Pass true if you want an exception to be thrown in the child path does not exist. Defaults to false.

      Returns boolean

      true if the child path is a descendant of parentDir