From a4cc313446550aa8ee2c05b2147001087d3ee45f Mon Sep 17 00:00:00 2001 From: Im-Beast Date: Thu, 27 Jun 2024 19:29:46 +0200 Subject: [PATCH] fix(zap): add explicit return type for `replaceAll` --- src/utils/strings.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/utils/strings.ts b/src/utils/strings.ts index d9f24d5..ee8ea2b 100644 --- a/src/utils/strings.ts +++ b/src/utils/strings.ts @@ -9,12 +9,15 @@ export function replace( string: string, search: string, - replaceValue: string, + replaceValue: string ): string { const searchIndex = string.indexOf(search); if (searchIndex === -1) return string; - return string.slice(0, searchIndex) + replaceValue + - string.slice(searchIndex + search.length); + return ( + string.slice(0, searchIndex) + + replaceValue + + string.slice(searchIndex + search.length) + ); } /** @@ -29,8 +32,8 @@ export function replace( export function replaceAll( string: string, search: string, - replaceValue: string, -) { + replaceValue: string +): string { let searchIndex = string.indexOf(search); if (searchIndex === -1) return string;