From 253c5dbc909caea0a90d3378df77e5dfc09ca21f Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Wed, 18 Dec 2024 22:53:32 +0100 Subject: [PATCH] add missing trim function to figlet extention --- js/figlet.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/figlet.js b/js/figlet.js index 8ab3e658..8dd724f8 100644 --- a/js/figlet.js +++ b/js/figlet.js @@ -95,4 +95,8 @@ function all_include(items, list) { return items.every(item => list.includes(item)); } + + function trim(str) { + return str.replace(/[\s\n]+$/, '').replace(/^\s+\n/, ''); + } });