Skip to content

Path

6 exports Added in v1.0.0 Source

Layer

layer

Added in v1.0.0 Source

An implementation of the Path interface that can be used in all environments (including browsers).

It uses the POSIX standard for paths.

Signature

declare const layer: Layer<Path>;

Model

Path interface

Added in v1.0.0 Source

Signature

interface Path {
  readonly [TypeId]: typeof TypeId;
  readonly basename: (path: string, suffix?: string) => string;
  readonly dirname: (path: string) => string;
  readonly extname: (path: string) => string;
  readonly format: (pathObject: Partial<Path.Parsed>) => string;
  readonly fromFileUrl: (url: URL) => Effect<string, BadArgument>;
  readonly isAbsolute: (path: string) => boolean;
  readonly join: (...paths: readonly Array<string>) => string;
  readonly normalize: (path: string) => string;
  readonly parse: (path: string) => Parsed;
  readonly relative: (from: string, to: string) => string;
  readonly resolve: (...pathSegments: readonly Array<string>) => string;
  readonly sep: string;
  readonly toFileUrl: (path: string) => Effect<URL, BadArgument>;
  readonly toNamespacedPath: (path: string) => string;
}

Other

Path

Added in v1.0.0 Source

Tag

Path

Added in v1.0.0 Source

Signature

declare const Path: Tag<Path, Path>;

Type Ids

TypeId

Added in v1.0.0 Source

Signature

declare const TypeId: unique symbol;

TypeId type

Added in v1.0.0 Source

Signature

type TypeId = typeof TypeId;