Skip to main content
Version: 1.x

addExt()

const addExt: (file, ext) => string = upath.addExt

Adds .ext to filename, but only if it doesn't already have the exact extension.

Parameters​

ParameterTypeDescription

file

string

string filename to add extension to

ext

string

string extension to add

Returns​

string