Options
All
  • Public
  • Public/Protected
  • All
Menu

Module src/object/paths

Index

Functions

Const comparePaths

  • comparePaths(a: string, b: string): number
  • Comparator for path in dot notation, ordering by it's parts alphabetically

    Parameters

    • a: string
    • b: string

    Returns number

Const comparePathsByDepth

  • comparePathsByDepth(a: string, b: string): number
  • Comparator for dot notation, ordering by depth first, then by it's parts if the same depth

    Parameters

    • a: string
    • b: string

    Returns number

Const depthOfPath

  • depthOfPath(value: string): number
  • Returns the depth of the given path in dot notation

    Parameters

    • value: string

    Returns number

    ;

Const getParentPath

  • getParentPath(path: string): string
  • Get the tail on the right of the string separate

    Parameters

    • path: string

    Returns string

Const headOfPath

  • headOfPath(key: string): string
  • Get the head of the string, separated by dot notation

    Parameters

    • key: string

    Returns string

Const joinPaths

  • joinPaths(...args: (string | number)[]): string
  • Join path parts together and returns the resulting dot notation

    Parameters

    • Rest ...args: (string | number)[]

    Returns string

Const removeParentPath

  • removeParentPath(path: string): string
  • Parent path of the given path in dot notation

    Parameters

    • path: string

    Returns string

Const tailOfPath

  • tailOfPath(key: string): string
  • Get the tail of the given path separated by dot notation

    Parameters

    • key: string

    Returns string

Generated using TypeDoc