Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BasePath

Helper class that determines the common base path of a set of files.

In the first step all files must be passed to add. Afterwards trim can be used to retrieve the shortest path relative to the determined base path.

Hierarchy

  • BasePath

Index

Properties

Methods

Properties

Private basePaths

basePaths: string[] = []

List of known base paths.

Methods

add

  • add(fileName: string): void
  • Add the given file path to this set of base paths.

    Parameters

    • fileName: string

      The absolute filename that should be added to the base path.

    Returns void

reset

  • reset(): void

trim

  • trim(fileName: string): string
  • Trim the given filename by the determined base paths.

    Parameters

    • fileName: string

      The absolute filename that should be trimmed.

    Returns string

    The trimmed version of the filename.

Static normalize

  • normalize(path: string): string
  • Normalize the given path.

    Parameters

    • path: string

      The path that should be normalized.

    Returns string

    Normalized version of the given path.

Generated using TypeDoc