1
0
mirror of https://github.com/S2-/minifyfromhtml.git synced 2025-08-04 04:40:05 +02:00

update packages to latest version

This commit is contained in:
s2
2022-08-20 18:51:33 +02:00
parent 09663a35a5
commit 806ebf9a57
4513 changed files with 366205 additions and 92512 deletions

View File

@@ -64,10 +64,8 @@ class DefaultsError extends Error {
function defaults(args, defs, croak) {
if (args === true) {
args = {};
}
if (args != null && typeof args === "object") {
args = Object.assign({}, args);
} else if (args != null && typeof args === "object") {
args = {...args};
}
const ret = args || {};
@@ -251,7 +249,15 @@ function regexp_source_fix(source) {
return (escaped ? "" : "\\") + lineTerminatorEscape[match];
});
}
const all_flags = "gimuy";
// Subset of regexps that is not going to cause regexp based DDOS
// https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS
const re_safe_regexp = /^[\\/|\0\s\w^$.[\]()]*$/;
/** Check if the regexp is safe for Terser to create without risking a RegExp DOS */
export const regexp_is_safe = (source) => re_safe_regexp.test(source);
const all_flags = "dgimsuy";
function sort_regexp_flags(flags) {
const existing_flags = new Set(flags.split(""));
let out = "";