[internals] check for string type else return early
This commit is contained in:
parent
8733efa14f
commit
5e9909954a
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue