Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RelativePattern

A relative pattern is a helper to construct glob patterns that are matched relatively to a base path. The base path can either be an absolute file path or a workspace folder.

Hierarchy

  • RelativePattern

Index

Constructors

Properties

Constructors

constructor

  • Creates a new relative pattern object with a base path and pattern to match. This pattern will be matched on file paths relative to the base path.

    Parameters

    • base: WorkspaceFolder | string

      A base file path to which this pattern will be matched against relatively.

    • pattern: string

      A file glob pattern like *.{ts,js} that will be matched on file paths relative to the base path.

    Returns RelativePattern

Properties

base

base: string

A base file path to which this pattern will be matched against relatively.

pattern

pattern: string

A file glob pattern like *.{ts,js} that will be matched on file paths relative to the base path.

Example: Given a base of /home/work/folder and a file path of /home/work/folder/index.js, the file glob pattern will match on index.js.