@jiway/firestorm-core - v1.1.1
    Preparing search index...

    Class Path

    Holds a more details version of a path information. This object is readonly

    Some segments have special meanings listed in SpecialSegments

    Index

    Accessors

    • get depth(): number

      The amount of segments composing the path

      Returns number

    • get documentDepth(): number

      The amount of full collection-document in the path

      Returns number

    • get isCollection(): boolean

      If the path would land on a collection

      Returns boolean

    • get isDocument(): boolean

      If the path would land on a document

      Returns boolean

    • get isEmpty(): boolean

      If there is no path

      Returns boolean

    • get isRoot(): boolean

      If no collection-document couple is complete in the path

      Returns boolean

    • get isSubcollection(): boolean

      If the path would land on a collection that isn't a root collection

      Returns boolean

    • get lastSegment(): string

      Gets the last segment of the path

      Returns string

    • get path(): string

      String representing the path

      Returns string

    • get pathToDeepestCollection(): string

      Gets the path to the deepest collection this path can reach

      Returns string

    • get segments(): readonly string[]

      Gets all the segments in the path

      Returns readonly string[]

    Methods

    • Converts the given object to path

      Parameters

      • pathLike: PathLike | undefined

        Object to convert

      Returns Path

      The path built

    • Build a Path object from its segmented representation

      Parameters

      • segments: string[]

        Segmented representation of the path

      Returns Path

      The path

    • Build a Path object from its string representation

      Parameters

      • pathString: string

        String representation of the path

      Returns Path

      The path

    • Merges multiple path into one

      Parameters

      • ...pathLikes: PathLike[]

        List of paths to merge.

      Returns Path

      The merged paths