@technobuddha/library
Version:
A large library of useful functions
16 lines (15 loc) • 458 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureSuffix = void 0;
/**
* 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
*/
function ensureSuffix(input, suffix) {
return input.endsWith(suffix) ? input : input + suffix;
}
exports.ensureSuffix = ensureSuffix;
exports.default = ensureSuffix;