Skip to content

[F] getAnyExtensionFromPath

function getAnyExtensionFromPath(path): string

Gets the file extension for a path. Normalizes it to lower case.

getAnyExtensionFromPath("/path/to/file.ext") === ".ext"
getAnyExtensionFromPath("/path/to/file.ext/") === ".ext"
getAnyExtensionFromPath("/path/to/file") === ""
getAnyExtensionFromPath("/path/to.ext/file") === ""

Parameters

ParameterType
pathstring

Returns

string