summaryrefslogtreecommitdiffstats
path: root/web_src/js/utils.js
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-10-21 13:02:24 +0200
committerGitHub <noreply@github.com>2020-10-21 19:02:24 +0800
commit58e1e5ba13a4a0e134afea1b4010fa363b27e38e (patch)
tree549e5d48edd444144803a8f729386b0671e18bdd /web_src/js/utils.js
parent965861043ae4daf7ae50460edf5533e52980bdb1 (diff)
downloadgitea-58e1e5ba13a4a0e134afea1b4010fa363b27e38e.tar.gz
gitea-58e1e5ba13a4a0e134afea1b4010fa363b27e38e.zip
Update some JS dependencies (#13222)
* Update some JS dependencies - Update selective dependencies that are compatible with webpack 4. We can not upgrade to webpack 5 yet because `license-webpack-plugin` is incompatible. - Enable a few new eslint rules and fix new issues * fix comment Co-authored-by: techknowlogick <techknowlogick@gitea.io> Co-authored-by: zeripath <art27@cantab.net>
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, '');
}