docomet
    Preparing search index...

    Class DocometPath

    Path

    Hierarchy (View Summary)

    Index

    Constructors

    • Creates a DocometPath instance

      Parameters

      • dir: string

        The directory path

      • Optionalname: string

        The file name

      • Optionalext: string

        The file extension

      Returns DocometPath

    Accessors

    Methods

    • Get the JSON representation of the path

      Returns string

      The JSON representation

    • Get the posix string representation of the path

      Returns string

      The posix string representation

    • Get the string representation of the path

      Returns string

      The string representation

    • Create a new DocometPath instance with updated properties

      Parameters

      • updates: Partial<{ dir: string; ext: string; name: string }>

        The updated properties

      Returns DocometPath

      The DocometPath instance

    • Convert a path to an absolute path

      Parameters

      • path: string

        The path

      Returns string

      The absolute path

    • Check if a path does not exist

      Parameters

      • path: string

        The path

      Returns boolean

      true if does not exist, otherwise false

    • Check if a path exists

      Parameters

      • path: string

        The path

      Returns boolean

      true if exists, otherwise false

    • Find a file or directory up the directory tree

      Parameters

      • name: string

        The name to find

      • startPath: string = DocometPath.#rootPath

        The path to start searching from

      Returns string | undefined

      The absolute path to the found item, or undefined if not found

    • Join paths by the platform separator

      Parameters

      • this: void
      • ...paths: string[]

        The paths

      Returns string

      The joined path

    • Join paths by the posix separator

      Parameters

      • this: void
      • ...paths: string[]

        The paths

      Returns string

      The joined path

    • Create a new DocometPath instance

      Parameters

      • ...args: [dir: string, name?: string, ext?: string]

        The constructor arguments

      Returns DocometPath

      The DocometPath instance

    • Get the relative path from the root path

      Parameters

      • targetPath: string

        The target path

      • rootPath: string = DocometPath.#rootPath

        The root path

      Returns string

      The relative path

    • Split a path by the platform separator

      Parameters

      • this: void
      • path: string

        The path

      Returns string[]

      The split path

    • Split a path by the posix separator

      Parameters

      • this: void
      • path: string

        The path

      Returns string[]

      The split path