kaven-basic - v6.0.0
    Preparing search index...

    Function GetBaseDir

    • This function extracts the base directory from the provided pathStr. If trimLastSlash is true, the trailing slash or backslash is removed from the result. Handles both forward slashes (/) and backslashes (``) as path separators.

      Parameters

      • pathStr: string

        The input path string from which to extract the base directory.

      • trimLastSlash: boolean = false

        Optional. If true, trims the trailing slash or backslash from the result. Defaults to false.

      Returns string

      The base directory of the given path string, optionally trimmed of its trailing slash or backslash.

      C:/a/b/c  return C:/a/b/
      

      1.0.5

      2025-07-03