This package has been deprecated
Author message:
Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
ensure-string-endswith
1.0.1 • Public • Published ensure-string-endswith
Creates a function that appends a given character to a string, if (and only if) it does not already end with that character.
usage
var anyString = 'anyString',
stringEndingWithSlash = 'endsWith/',
ensureStringEndsWithSlash = ensureStringEndsWith('/');
ensureStringEndsWithSlash(anyString) === anyString + '/';
ensureStringEndsWithSlash(stringEndingWithSlash) === stringEndingWithSlash;
Versions
Current Tags
- VersionDownloads (Last 7 Days)
Version History
- VersionDownloads (Last 7 Days)
Package Sidebar
Install
npm i ensure-string-endswith
Weekly Downloads