1
0
Fork 0
forked from forgejo/forgejo

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>
This commit is contained in:
silverwind 2020-10-21 13:02:24 +02:00 committed by GitHub
parent 965861043a
commit 58e1e5ba13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 878 additions and 697 deletions

View file

@ -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, '');
}