webpb 0.0.22 → 0.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +30 -36
- package/package.json +8 -7
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,t,o=[]){if(!(!e||!t||typeof e!="object"||typeof t!="object"))for(const[r,n]of Object.entries(e))n!==void 0&&o.indexOf(r)<0&&(t[r]=n)}function l(e,t){if(e==null||typeof e!="object")return null;for(const o of t.split("."))if(e=e[o],e==null)return null;return e}function y(e,t){const o=[];for(const[r,n]of Object.entries(t)){if(n==null||typeof n=="function")continue;let i;Array.isArray(n)?i=n.join(","):typeof n=="object"?i=Object.entries(n).map(([u,c])=>`${u},${c}`).join(";"):i=String(n);const f=encodeURIComponent(i);f&&o.push(`${r}=${f}`)}return o.length?`${e}${o.join("&")}`:""}function j(e,t){if(!e||typeof e!="object"||Array.isArray(e))return e;const o={};for(const[r,n]of Object.entries(e)){const i=n==null?void 0:n.toAlias;typeof i=="function"?o[r]=i():t&&t[r]?o[t[r]]=n:o[r]=n}return o}function p(e,t){return Object.entries(e).reduce((o,[r,n])=>(o[r]=t(n),o),{})}exports.assign=s;exports.getter=l;exports.mapValues=p;exports.query=y;exports.toAlias=j;
|
package/dist/index.mjs
CHANGED
|
@@ -1,51 +1,45 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!(!e || !
|
|
3
|
-
for (const [r,
|
|
4
|
-
|
|
1
|
+
function s(e, t, o = []) {
|
|
2
|
+
if (!(!e || !t || typeof e != "object" || typeof t != "object"))
|
|
3
|
+
for (const [r, n] of Object.entries(e))
|
|
4
|
+
n !== void 0 && o.indexOf(r) < 0 && (t[r] = n);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
if (!o)
|
|
8
|
-
return !1;
|
|
9
|
-
for (const n of o)
|
|
10
|
-
if (n === e)
|
|
11
|
-
return !0;
|
|
12
|
-
return !1;
|
|
13
|
-
}
|
|
14
|
-
function c(e, o) {
|
|
6
|
+
function l(e, t) {
|
|
15
7
|
if (e == null || typeof e != "object")
|
|
16
8
|
return null;
|
|
17
|
-
for (const
|
|
18
|
-
if (e = e[
|
|
19
|
-
return
|
|
9
|
+
for (const o of t.split("."))
|
|
10
|
+
if (e = e[o], e == null)
|
|
11
|
+
return null;
|
|
20
12
|
return e;
|
|
21
13
|
}
|
|
22
|
-
function
|
|
23
|
-
const
|
|
24
|
-
for (const [r,
|
|
25
|
-
if (
|
|
14
|
+
function y(e, t) {
|
|
15
|
+
const o = [];
|
|
16
|
+
for (const [r, n] of Object.entries(t)) {
|
|
17
|
+
if (n == null || typeof n == "function")
|
|
26
18
|
continue;
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
let i;
|
|
20
|
+
Array.isArray(n) ? i = n.join(",") : typeof n == "object" ? i = Object.entries(n).map(([u, c]) => `${u},${c}`).join(";") : i = String(n);
|
|
21
|
+
const f = encodeURIComponent(i);
|
|
22
|
+
f && o.push(`${r}=${f}`);
|
|
29
23
|
}
|
|
30
|
-
return
|
|
24
|
+
return o.length ? `${e}${o.join("&")}` : "";
|
|
31
25
|
}
|
|
32
|
-
function
|
|
26
|
+
function j(e, t) {
|
|
33
27
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
34
28
|
return e;
|
|
35
|
-
const
|
|
36
|
-
for (const [r,
|
|
37
|
-
const
|
|
38
|
-
typeof
|
|
29
|
+
const o = {};
|
|
30
|
+
for (const [r, n] of Object.entries(e)) {
|
|
31
|
+
const i = n == null ? void 0 : n.toAlias;
|
|
32
|
+
typeof i == "function" ? o[r] = i() : t && t[r] ? o[t[r]] = n : o[r] = n;
|
|
39
33
|
}
|
|
40
|
-
return
|
|
34
|
+
return o;
|
|
41
35
|
}
|
|
42
|
-
function
|
|
43
|
-
return Object.entries(e).reduce((
|
|
36
|
+
function p(e, t) {
|
|
37
|
+
return Object.entries(e).reduce((o, [r, n]) => (o[r] = t(n), o), {});
|
|
44
38
|
}
|
|
45
39
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
40
|
+
s as assign,
|
|
41
|
+
l as getter,
|
|
42
|
+
p as mapValues,
|
|
43
|
+
y as query,
|
|
44
|
+
j as toAlias
|
|
51
45
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"description": "The webpb runtime library",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "rimraf build/**/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.ts && copyfiles ./README.md ./package.json build",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": [
|
|
29
29
|
{
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
30
31
|
"import": "./dist/index.mjs",
|
|
31
32
|
"require": "./dist/index.cjs"
|
|
32
33
|
},
|
|
@@ -35,13 +36,13 @@
|
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
38
|
"@eslint/compat": "^1.2.4",
|
|
38
|
-
"@types/node": "^22.10.
|
|
39
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
40
|
-
"@typescript-eslint/parser": "^8.
|
|
39
|
+
"@types/node": "^22.10.2",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.18.2",
|
|
41
|
+
"@typescript-eslint/parser": "^8.18.2",
|
|
41
42
|
"@vitest/coverage-v8": "^2.1.8",
|
|
42
43
|
"copyfiles": "^2.4.1",
|
|
43
44
|
"dts-bundle-generator": "^9.5.1",
|
|
44
|
-
"eslint": "^9.
|
|
45
|
+
"eslint": "^9.17.0",
|
|
45
46
|
"eslint-config-prettier": "^9.1.0",
|
|
46
47
|
"eslint-plugin-import": "^2.31.0",
|
|
47
48
|
"eslint-plugin-import-quotes": "^0.0.1",
|
|
@@ -53,8 +54,8 @@
|
|
|
53
54
|
"rimraf": "^6.0.1",
|
|
54
55
|
"ts-node": "^10.9.2",
|
|
55
56
|
"typescript": "^5.7.2",
|
|
56
|
-
"typescript-eslint": "^8.
|
|
57
|
-
"vite": "^6.0.
|
|
57
|
+
"typescript-eslint": "^8.18.2",
|
|
58
|
+
"vite": "^6.0.5",
|
|
58
59
|
"vitest": "^2.1.8"
|
|
59
60
|
}
|
|
60
61
|
}
|