suffix()

Always ensures that a string ends with a specific substring.

This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 60 times.

Parameters

{string|undefined|null} str
This will be the string to which the suffix will be appended unless the test proves that it doesn't need to be appended. Specifying undefined or null will cause a partial function to be returned.
{string} strSuffix
This will be the suffix to add to str if it needs to be added.
{RegExp=} opt_rgxTester Optional
Regular expression to test against the string to be suffixed. If the string tests negative against this regular expression strSuffix will be appended to the end of it.

Returns

{string|function(string)}
If str is not given a partial function will be returned which will await the string value of str. If opt_rgxTester isn't given, the str will be returned and it will be suffixed with strSuffix if it isn't already at the end of it. If opt_rgxTester is given and str tests negative against it str suffixed with strSuffix will be returned. Otherwise str will be returned.