UNPKG

@technobuddha/library

Version:
12 lines (11 loc) 317 B
/** * 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;