Function
Static Public Summary | ||
public |
Group paths by their parent path. |
|
public |
isAscendant(subject: string, descendant: string): boolean Whether a path is an ascendant of another one. |
|
public |
isDescendant(subject: string, ascendant: string): boolean Whether a path is an descendant of another one. |
|
public |
Whether a file is a directory or not. |
|
public |
isUniqueAndNotDescendant(path: string, index: number, paths: string[]): boolean Whether a path is unique and does not have any ascendant within an array of paths. |
Static Public
public byDirname(paths: string[]): Object source
import {byDirname} from 'files-by-directory/src/path.js'
Group paths by their parent path.
Params:
Name | Type | Attribute | Description |
paths | string[] | Paths. |
public isAscendant(subject: string, descendant: string): boolean source
import {isAscendant} from 'files-by-directory/src/path.js'
Whether a path is an ascendant of another one.
public isDescendant(subject: string, ascendant: string): boolean source
import {isDescendant} from 'files-by-directory/src/path.js'
Whether a path is an descendant of another one.
public isDir(path: string | Buffer | URL): Promise<boolean> source
import {isDir} from 'files-by-directory/src/fs.js'
Whether a file is a directory or not.
Params:
Name | Type | Attribute | Description |
path | string | Buffer | URL |
public isUniqueAndNotDescendant(path: string, index: number, paths: string[]): boolean source
import {isUniqueAndNotDescendant} from 'files-by-directory/src/path.js'
Whether a path is unique and does not have any ascendant within an array of paths.
Return:
boolean |
|