• Return the last portion of a path. Similar to the Unix basename command. Often used to extract the file name from a fully qualified path.

    Parameters

    • path: string

      the path to evaluate.

    • Optionalsuffix: string

      optionally, an extension to remove from the result.

    Returns string

    if path is not a string or if ext is given and is not a string.