From f55fce78bfdd3c9054f4d3faafbf37729373fed5 Mon Sep 17 00:00:00 2001 From: Tobias Speicher Date: Tue, 5 Apr 2022 17:50:33 +0200 Subject: [PATCH] fix: replace deprecated String.prototype.substr() .substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher --- src/core/cache-storage.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/cache-storage.ts b/src/core/cache-storage.ts index 2be98ed..c2cc041 100644 --- a/src/core/cache-storage.ts +++ b/src/core/cache-storage.ts @@ -172,6 +172,6 @@ const INLINE_IMG = /^data:image\/.*/i; const isRenderable = (src: string): boolean => FEATURES.SUPPORT_SVG_DRAWING || !isSVG(src); const isInlineImage = (src: string): boolean => INLINE_IMG.test(src); const isInlineBase64Image = (src: string): boolean => INLINE_BASE64.test(src); -const isBlobImage = (src: string): boolean => src.substr(0, 4) === 'blob'; +const isBlobImage = (src: string): boolean => src.slice(0, 4) === 'blob'; -const isSVG = (src: string): boolean => src.substr(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src); +const isSVG = (src: string): boolean => src.slice(-3).toLowerCase() === 'svg' || INLINE_SVG.test(src);