## Index

### Enumerations

- Branch
- Kind

### Type aliases

- DirectoryPath
- DistinctivePath
- FilePath
- Path

### Functions

- combine
- directory
- file
- fromPosix
- isBranch
- isDirectory
- isFile
- isRootDirectory
- isSameBranch
- isSameKind
- kind
- log
- map
- parent
- removeBranch
- root
- terminus
- toPosix
- unwrap

## Type aliases

### DirectoryPath

DirectoryPath: { directory: Path }

- Defined in path.ts:21

#### Type declaration

- ##### directory: Path

### DistinctivePath

DistinctivePath: DirectoryPath | FilePath

- Defined in path.ts:27

The primarily used type for paths.

### FilePath

FilePath: { file: Path }

- Defined in path.ts:22

#### Type declaration

- ##### file: Path

### Path

Path: string[]

- Defined in path.ts:19

## Functions

### combine

- combine(a: DirectoryPath, b: FilePath): FilePath
- combine(a: DirectoryPath, b: DirectoryPath): DirectoryPath
- combine(a: DirectoryPath, b: DistinctivePath): DistinctivePath

- - Defined in path.ts:105

  Combine two `DistinctivePath`s.

  #### Parameters

  - ##### a: DirectoryPath

  - ##### b: FilePath

  #### Returns FilePath

- - Defined in path.ts:106

  #### Parameters

  - ##### a: DirectoryPath

  - ##### b: DirectoryPath

  #### Returns DirectoryPath

- - Defined in path.ts:107

  #### Parameters

  - ##### a: DirectoryPath

  - ##### b: DistinctivePath

  #### Returns DistinctivePath

### directory

- directory(...args: Path): DirectoryPath

- - Defined in path.ts:37

  Utility function to create a `DirectoryPath`

  #### Parameters

  - ##### Rest ...args: Path

  #### Returns DirectoryPath

### file

- file(...args: Path): FilePath

- - Defined in path.ts:47

  Utility function to create a `FilePath`

  #### Parameters

  - ##### Rest ...args: Path

  #### Returns FilePath

### fromPosix

- fromPosix(path: string): DistinctivePath

- - Defined in path.ts:74

  Transform a string into a `DistinctivePath`.

  Directories should have the format `path/to/dir/` and files should have the format `path/to/file`.

  Leading forward slashes are removed too, so you can pass absolute paths.

  #### Parameters

  - ##### path: string

  #### Returns DistinctivePath

### isBranch

- isBranch(branch: Branch, path: DistinctivePath): boolean

- - Defined in path.ts:115

  Is this `DistinctivePath` of the given `Branch`?

  #### Parameters

  - ##### branch: Branch

  - ##### path: DistinctivePath

  #### Returns boolean

### isDirectory

- isDirectory(path: DistinctivePath): path is DirectoryPath

- - Defined in path.ts:122

  Is this `DistinctivePath` a directory?

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns path is DirectoryPath

### isFile

- isFile(path: DistinctivePath): path is FilePath

- - Defined in path.ts:129

  Is this `DistinctivePath` a file?

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns path is FilePath

### isRootDirectory

- isRootDirectory(path: DirectoryPath): boolean

- - Defined in path.ts:136

  Is this `DirectoryPath` a root directory?

  #### Parameters

  - ##### path: DirectoryPath

  #### Returns boolean

### isSameBranch

- isSameBranch(a: DistinctivePath, b: DistinctivePath): boolean

- - Defined in path.ts:143

  Check if two `DistinctivePath` have the same `Branch`.

  #### Parameters

  - ##### a: DistinctivePath

  - ##### b: DistinctivePath

  #### Returns boolean

### isSameKind

- isSameKind(a: DistinctivePath, b: DistinctivePath): boolean

- - Defined in path.ts:150

  Check if two `DistinctivePath` are of the same kind.

  #### Parameters

  - ##### a: DistinctivePath

  - ##### b: DistinctivePath

  #### Returns boolean

### kind

- kind(path: DistinctivePath): Kind

- - Defined in path.ts:159

  What `Kind` of path are we dealing with?

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Kind

### log

- log(path: Path): string

- - Defined in path.ts:222

  Render a raw `Path` to a string for logging purposes.

  #### Parameters

  - ##### path: Path

  #### Returns string

### map

- map(fn: (p: Path) => Path, path: DistinctivePath): DistinctivePath

- - Defined in path.ts:167

  Map a `DistinctivePath`.

  #### Parameters

  - ##### fn: (p: Path) => Path

    - - (p: Path): Path

      - #### Parameters

        - ##### p: Path

        #### Returns Path

  - ##### path: DistinctivePath

  #### Returns DistinctivePath

### parent

- parent(path: DistinctivePath): Maybe<DirectoryPath>

- - Defined in path.ts:176

  Get the parent directory of a `DistinctivePath`.

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Maybe<DirectoryPath>

### removeBranch

- removeBranch(path: DistinctivePath): DistinctivePath

- - Defined in path.ts:185

  Remove the `Branch` of a `DistinctivePath` (ie. the top-level directory)

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns DistinctivePath

### root

- root(): DirectoryPath

- - Defined in path.ts:57

  Utility function to create a root `DirectoryPath`

  #### Returns DirectoryPath

### terminus

- terminus(path: DistinctivePath): Maybe<string>

- - Defined in path.ts:195

  Get the last part of the path.

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Maybe<string>

### toPosix

- toPosix(path: DistinctivePath, __namedParameters?: { absolute: boolean }): string

- - Defined in path.ts:87

  Transform a `DistinctivePath` into a string.

  Directories will have the format `path/to/dir/` and files will have the format `path/to/file`.

  #### Parameters

  - ##### path: DistinctivePath

  - ##### __namedParameters: { absolute: boolean } = ...

    - ##### absolute: boolean

  #### Returns string

### unwrap

- unwrap(path: DistinctivePath): Path

- - Defined in path.ts:204

  Unwrap a `DistinctivePath`.

  #### Parameters

  - ##### path: DistinctivePath

  #### Returns Path

Generated using TypeDoc