@wpazderski/js-utils
    Preparing search index...

    Utility class for handling FS path operations.

    Index

    Constructors

    Methods

    • Ensures that the given path is absolute. If it is not, it resolves it against the provided rootAbsolutePath or the current working directory.

      Parameters

      • path: string

        The path to ensure is absolute.

      • OptionalrootAbsolutePath: string

        The root path to resolve against if the path is not absolute.

      Returns string

      The absolute path.

    • Sanitizes a directory path by replacing backslashes with forward slashes and optionally ensuring it has a trailing slash.

      Parameters

      • path: string

        The directory path to sanitize.

      • withTrailingSlash: boolean = true

        Whether to ensure the path ends with a trailing slash. Defaults to true.

      Returns string

      The sanitized directory path.

    • Sanitizes a file path by replacing backslashes with forward slashes.

      Parameters

      • path: string

        The file path to sanitize.

      Returns string

      The sanitized file path.