[internals] check for string type else return early

This commit is contained in:
Salakar 2018-07-10 21:37:17 +01:00
parent 8733efa14f
commit 5e9909954a
1 changed files with 1 additions and 0 deletions

View File

@ -196,6 +196,7 @@ export function noop(): void {}
* @returns {*}
*/
export function stripTrailingSlash(str: string): string {
if (!isString(str)) return str;
return str.endsWith('/') ? str.slice(0, -1) : str;
}