fix price and modular

This commit is contained in:
2026-02-01 17:38:39 +03:30
parent 55f34aa15d
commit 164542d3e2
801 changed files with 16129 additions and 14478 deletions
+16 -9
View File
@@ -21,23 +21,23 @@ const u = function(n2, t2, o2) {
return e(r2 + 36 * n2 / (n2 + 38));
};
function toASCII(o2) {
return function(n2, o3) {
return (function(n2, o3) {
const e2 = n2.split("@");
let r2 = "";
e2.length > 1 && (r2 = e2[0] + "@", n2 = e2[1]);
const s2 = function(n3, t2) {
const s2 = (function(n3, t2) {
const o4 = [];
let e3 = n3.length;
for (; e3--; ) {
o4[e3] = t2(n3[e3]);
}
return o4;
}((n2 = n2.replace(t, ".")).split("."), o3).join(".");
})((n2 = n2.replace(t, ".")).split("."), o3).join(".");
return r2 + s2;
}(o2, function(t2) {
return n.test(t2) ? "xn--" + function(n2) {
})(o2, function(t2) {
return n.test(t2) ? "xn--" + (function(n2) {
const t3 = [];
const o3 = (n2 = function(n3) {
const o3 = (n2 = (function(n3) {
const t4 = [];
let o4 = 0;
const e2 = n3.length;
@@ -51,7 +51,7 @@ function toASCII(o2) {
}
}
return t4;
}(n2)).length;
})(n2)).length;
let f = 128;
let i = 0;
let l = 72;
@@ -85,7 +85,7 @@ function toASCII(o2) {
++i, ++f;
}
return t3.join("");
}(t2) : t2;
})(t2) : t2;
});
}
@@ -267,7 +267,10 @@ function withBase(input, base) {
}
const _base = withoutTrailingSlash(base);
if (input.startsWith(_base)) {
return input;
const nextChar = input[_base.length];
if (!nextChar || nextChar === "/" || nextChar === "?") {
return input;
}
}
return joinURL(_base, input);
}
@@ -279,6 +282,10 @@ function withoutBase(input, base) {
if (!input.startsWith(_base)) {
return input;
}
const nextChar = input[_base.length];
if (nextChar && nextChar !== "/" && nextChar !== "?") {
return input;
}
const trimmed = input.slice(_base.length);
return trimmed[0] === "/" ? trimmed : "/" + trimmed;
}
+15 -14
View File
@@ -1,6 +1,6 @@
{
"name": "ufo",
"version": "1.6.1",
"version": "1.6.3",
"description": "URL utils for humans",
"repository": "unjs/ufo",
"license": "MIT",
@@ -8,8 +8,9 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"import": "./dist/index.mjs"
"default": "./dist/index.mjs"
},
"./*": "./*"
},
@@ -30,18 +31,18 @@
"test": "pnpm lint && vitest run --typecheck"
},
"devDependencies": {
"@types/node": "^22.14.0",
"@vitest/coverage-v8": "^3.1.1",
"automd": "^0.4.0",
"changelogen": "^0.6.1",
"eslint": "^9.24.0",
"eslint-config-unjs": "^0.4.2",
"jiti": "^2.4.2",
"prettier": "^3.5.3",
"typescript": "^5.8.3",
"unbuild": "^3.5.0",
"@types/node": "^25.0.8",
"@vitest/coverage-v8": "^4.0.17",
"automd": "^0.4.2",
"changelogen": "^0.6.2",
"eslint": "^9.39.2",
"eslint-config-unjs": "^0.6.2",
"jiti": "^2.6.1",
"prettier": "^3.7.4",
"typescript": "^5.9.3",
"unbuild": "^3.6.1",
"untyped": "^2.0.0",
"vitest": "^3.1.1"
"vitest": "^4.0.17"
},
"packageManager": "pnpm@10.7.1"
"packageManager": "pnpm@10.28.0"
}