@technobuddha/library
Version:
A large library of useful functions
12 lines (11 loc) • 317 B
JavaScript
/**
* Add a suffix to a string, if it does not already have the suffix
*
* @param input The string
* @param suffix The suffix
* @returns The string followed by the suffix
*/
export function ensureSuffix(input, suffix) {
return input.endsWith(suffix) ? input : input + suffix;
}
export default ensureSuffix;