- Linting (ESLint): Simplify regexes

- npm: Update scripts to reflect removal of `all_tests.html`;
  remove `browser-test` script
- npm: Update devDeps
This commit is contained in:
Brett Zamir
2019-11-30 11:41:01 +08:00
parent 3200e0ab8e
commit a59170fbe1
24 changed files with 213 additions and 293 deletions

View File

@@ -386,7 +386,7 @@ var svgEditorExtension_server_opensave = (function () {
});
}
}, {
re: /^(\w{1})(\w{1})(\w{1})$/,
re: /^(\w)(\w)(\w)$/,
// re: /^(?<r>\w{1})(?<g>\w{1})(?<b>\w{1})$/,
example: ['#fb0', 'f0f'],
process: function process(_) {
@@ -1030,7 +1030,7 @@ var svgEditorExtension_server_opensave = (function () {
svg.compressSpaces = function (s) {
return s.replace(/[\s\r\t\n]+/gm, ' ');
return s.replace(/\s+/gm, ' ');
}; // ajax
// Todo: Replace with `fetch` and polyfill
@@ -1211,7 +1211,7 @@ var svgEditorExtension_server_opensave = (function () {
}, {
key: "getUnits",
value: function getUnits() {
return String(this.value).replace(/[0-9.-]/g, '');
return String(this.value).replace(/[\d.-]/g, '');
} // get the length as pixels
}, {
@@ -2528,8 +2528,8 @@ var svgEditorExtension_server_opensave = (function () {
.replace(/,/gm, ' ') // get rid of all commas
.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2') // separate commands from commands
.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2') // separate commands from commands
.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm, '$1 $2') // separate commands from points
.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2') // separate commands from points
.replace(/([MmZzLlHhVvCcSsQqTtAa])(\S)/gm, '$1 $2') // separate commands from points
.replace(/(\S)([MmZzLlHhVvCcSsQqTtAa])/gm, '$1 $2') // separate commands from points
.replace(/(\d)([+-])/gm, '$1 $2') // separate digits when no comma
.replace(/(\.\d*)(\.)/gm, '$1 $2') // separate digits when no comma
.replace(/([Aa](\s+\d+)(\s+\d+)(\s+\d+))\s+([01])\s*([01])/gm, '$1 $5 $6 '); // shorthand elliptical arc path syntax
@@ -4002,7 +4002,7 @@ var svgEditorExtension_server_opensave = (function () {
}); // remove comments
css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm, ''); // eslint-disable-line unicorn/no-unsafe-regex
css = css.replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^\s*\/\/.*)/gm, ''); // eslint-disable-line unicorn/no-unsafe-regex
// replace whitespace
css = svg.compressSpaces(css);