Function getBaseFilenameFromRelativePath

  • Extracts the base filename from a relative path.

    This function takes a relative file path and returns only the filename without any preceding directory structure. It handles various edge cases such as empty strings, paths with no separators, and paths with trailing separators.

    Parameters

    • filePath: string

      The relative file path to process.

    Returns string

    The base filename extracted from the path, or an empty string if the input is invalid.