Remove useless escape characters
This commit is contained in:
parent
3b3884b1a1
commit
be9f964c18
7 changed files with 16 additions and 18 deletions
|
@ -99,8 +99,6 @@ module.exports = {
|
||||||
'Windows': 'readonly'
|
'Windows': 'readonly'
|
||||||
},
|
},
|
||||||
rules: {
|
rules: {
|
||||||
// TODO: Fix warnings and remove these rules
|
|
||||||
'no-useless-escape': ['warn']
|
|
||||||
},
|
},
|
||||||
settings: {
|
settings: {
|
||||||
polyfills: [
|
polyfills: [
|
||||||
|
|
|
@ -359,7 +359,7 @@ import toast from './toast/toast';
|
||||||
itemId: itemId,
|
itemId: itemId,
|
||||||
serverId: serverId,
|
serverId: serverId,
|
||||||
title: item.Name,
|
title: item.Name,
|
||||||
filename: item.Path.replace(/^.*[\\\/]/, '')
|
filename: item.Path.replace(/^.*[\\/]/, '')
|
||||||
}]);
|
}]);
|
||||||
getResolveFunction(getResolveFunction(resolve, id), id)();
|
getResolveFunction(getResolveFunction(resolve, id), id)();
|
||||||
});
|
});
|
||||||
|
|
|
@ -208,7 +208,7 @@ function getMimeType(type, container) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getParam(name, url) {
|
function getParam(name, url) {
|
||||||
name = name.replace(/[\[]/, '\\\[').replace(/[\]]/, '\\\]');
|
name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
|
||||||
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
||||||
const regex = new RegExp(regexS, 'i');
|
const regex = new RegExp(regexS, 'i');
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// TODO: Check if needed and move to external dependency
|
// TODO: Check if needed and move to external dependency
|
||||||
// From https://github.com/parshap/node-sanitize-filename
|
// From https://github.com/parshap/node-sanitize-filename
|
||||||
|
|
||||||
const illegalRe = /[\/\?<>\\:\*\|":]/g;
|
const illegalRe = /[/?<>\\:*|":]/g;
|
||||||
// eslint-disable-next-line no-control-regex
|
// eslint-disable-next-line no-control-regex
|
||||||
const controlRe = /[\x00-\x1f\x80-\x9f]/g;
|
const controlRe = /[\x00-\x1f\x80-\x9f]/g;
|
||||||
const reservedRe = /^\.+$/;
|
const reservedRe = /^\.+$/;
|
||||||
const windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;
|
const windowsReservedRe = /^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i;
|
||||||
const windowsTrailingRe = /[\. ]+$/;
|
const windowsTrailingRe = /[. ]+$/;
|
||||||
|
|
||||||
function isHighSurrogate(codePoint) {
|
function isHighSurrogate(codePoint) {
|
||||||
return codePoint >= 0xd800 && codePoint <= 0xdbff;
|
return codePoint >= 0xd800 && codePoint <= 0xdbff;
|
||||||
|
|
|
@ -119,7 +119,7 @@ import Dashboard from '../scripts/clientUtils';
|
||||||
function parseHtml(html, hasScript) {
|
function parseHtml(html, hasScript) {
|
||||||
if (hasScript) {
|
if (hasScript) {
|
||||||
html = replaceAll(html, '\x3c!--<script', '<script');
|
html = replaceAll(html, '\x3c!--<script', '<script');
|
||||||
html = replaceAll(html, '<\/script>--\x3e', '<\/script>');
|
html = replaceAll(html, '</script>--\x3e', '</script>');
|
||||||
}
|
}
|
||||||
|
|
||||||
const wrapper = document.createElement('div');
|
const wrapper = document.createElement('div');
|
||||||
|
|
|
@ -138,19 +138,19 @@ function supportsCssAnimation(allowPrefix) {
|
||||||
const uaMatch = function (ua) {
|
const uaMatch = function (ua) {
|
||||||
ua = ua.toLowerCase();
|
ua = ua.toLowerCase();
|
||||||
|
|
||||||
const match = /(edg)[ \/]([\w.]+)/.exec(ua) ||
|
const match = /(edg)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(edga)[ \/]([\w.]+)/.exec(ua) ||
|
/(edga)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(edgios)[ \/]([\w.]+)/.exec(ua) ||
|
/(edgios)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(edge)[ \/]([\w.]+)/.exec(ua) ||
|
/(edge)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(opera)[ \/]([\w.]+)/.exec(ua) ||
|
/(opera)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(opr)[ \/]([\w.]+)/.exec(ua) ||
|
/(opr)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
/(chrome)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
/(safari)[ /]([\w.]+)/.exec(ua) ||
|
||||||
/(firefox)[ \/]([\w.]+)/.exec(ua) ||
|
/(firefox)[ /]([\w.]+)/.exec(ua) ||
|
||||||
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||||
[];
|
[];
|
||||||
|
|
||||||
const versionMatch = /(version)[ \/]([\w.]+)/.exec(ua);
|
const versionMatch = /(version)[ /]([\w.]+)/.exec(ua);
|
||||||
|
|
||||||
let platform_match = /(ipad)/.exec(ua) ||
|
let platform_match = /(ipad)/.exec(ua) ||
|
||||||
/(iphone)/.exec(ua) ||
|
/(iphone)/.exec(ua) ||
|
||||||
|
|
|
@ -55,7 +55,7 @@ window.getWindowLocationSearch = function(win) {
|
||||||
|
|
||||||
// TODO: Move this elsewhere
|
// TODO: Move this elsewhere
|
||||||
window.getParameterByName = function(name, url) {
|
window.getParameterByName = function(name, url) {
|
||||||
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
|
||||||
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
||||||
const regex = new RegExp(regexS, 'i');
|
const regex = new RegExp(regexS, 'i');
|
||||||
const results = regex.exec(url || getWindowLocationSearch());
|
const results = regex.exec(url || getWindowLocationSearch());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue