From 5e9909954a8bea6b2954f1bf2f51c592b0a2d954 Mon Sep 17 00:00:00 2001 From: Salakar Date: Tue, 10 Jul 2018 21:37:17 +0100 Subject: [PATCH] [internals] check for string type else return early --- lib/utils/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/utils/index.js b/lib/utils/index.js index 5680419e..ab7361ab 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -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; }