summaryrefslogtreecommitdiffstats
path: root/web_src/js/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/utils.js')
-rw-r--r--web_src/js/utils.js12
1 files changed, 3 insertions, 9 deletions
diff --git a/web_src/js/utils.js b/web_src/js/utils.js
index d5f921f8dc..fc65644c7b 100644
--- a/web_src/js/utils.js
+++ b/web_src/js/utils.js
@@ -24,13 +24,7 @@ export function uniq(arr) {
return Array.from(new Set(arr));
}
-const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
-
-// generate a random string
-export function random(length) {
- let str = '';
- for (let i = 0; i < length; i++) {
- str += chars.charAt(Math.floor(Math.random() * chars.length));
- }
- return str;
+// strip <tags> from a string
+export function stripTags(text) {
+ return text.replace(/<[^>]*>?/gm, '');
}