webpb 0.0.24 → 0.0.25
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 -25
- package/package.json +18 -18
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(e,r,o=[]){if(!(!e||!r||typeof e!="object"||typeof r!="object"))for(const[i,n]of Object.entries(e))n!==void 0&&o.indexOf(i)<0&&(r[i]=n)}function c(e,r){if(e==null||typeof e!="object")return null;for(const o of r.split("."))if(e=e[o],e==null)return null;return e}function l(e,r){const o=[],i=(n,t)=>{n&&t&&o.push(`${n}=${encodeURIComponent(t)}`)};for(const[n,t]of Object.entries(r))if(!(t==null||typeof t=="function"))if(Array.isArray(t))i(n,t.join(","));else if(typeof t=="object")for(const u of Object.keys(t)){const f=t[u];u&&i(n,f?u+","+f:u)}else i(n,String(t));return o.length?`${e}${o.join("&")}`:""}function y(e,r){if(!e||typeof e!="object"||Array.isArray(e))return e;const o={};for(const[i,n]of Object.entries(e)){const t=n?.toAlias;typeof t=="function"?o[i]=t():r&&r[i]?o[r[i]]=n:o[i]=n}return o}function p(e,r){return Object.entries(e).reduce((o,[i,n])=>(o[i]=r(n),o),{})}exports.assign=s;exports.getter=c;exports.mapValues=p;exports.query=l;exports.toAlias=y;
|
package/dist/index.mjs
CHANGED
|
@@ -1,45 +1,50 @@
|
|
|
1
|
-
function
|
|
2
|
-
if (!(!e || !
|
|
3
|
-
for (const [
|
|
4
|
-
n !== void 0 && o.indexOf(
|
|
1
|
+
function c(e, r, o = []) {
|
|
2
|
+
if (!(!e || !r || typeof e != "object" || typeof r != "object"))
|
|
3
|
+
for (const [i, n] of Object.entries(e))
|
|
4
|
+
n !== void 0 && o.indexOf(i) < 0 && (r[i] = n);
|
|
5
5
|
}
|
|
6
|
-
function s(e,
|
|
6
|
+
function s(e, r) {
|
|
7
7
|
if (e == null || typeof e != "object")
|
|
8
8
|
return null;
|
|
9
|
-
for (const o of
|
|
9
|
+
for (const o of r.split("."))
|
|
10
10
|
if (e = e[o], e == null)
|
|
11
11
|
return null;
|
|
12
12
|
return e;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const o = []
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
function l(e, r) {
|
|
15
|
+
const o = [], i = (n, t) => {
|
|
16
|
+
n && t && o.push(`${n}=${encodeURIComponent(t)}`);
|
|
17
|
+
};
|
|
18
|
+
for (const [n, t] of Object.entries(r))
|
|
19
|
+
if (!(t == null || typeof t == "function"))
|
|
20
|
+
if (Array.isArray(t))
|
|
21
|
+
i(n, t.join(","));
|
|
22
|
+
else if (typeof t == "object")
|
|
23
|
+
for (const f of Object.keys(t)) {
|
|
24
|
+
const u = t[f];
|
|
25
|
+
f && i(n, u ? f + "," + u : f);
|
|
26
|
+
}
|
|
27
|
+
else
|
|
28
|
+
i(n, String(t));
|
|
24
29
|
return o.length ? `${e}${o.join("&")}` : "";
|
|
25
30
|
}
|
|
26
|
-
function
|
|
31
|
+
function y(e, r) {
|
|
27
32
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
28
33
|
return e;
|
|
29
34
|
const o = {};
|
|
30
|
-
for (const [
|
|
31
|
-
const
|
|
32
|
-
typeof
|
|
35
|
+
for (const [i, n] of Object.entries(e)) {
|
|
36
|
+
const t = n?.toAlias;
|
|
37
|
+
typeof t == "function" ? o[i] = t() : r && r[i] ? o[r[i]] = n : o[i] = n;
|
|
33
38
|
}
|
|
34
39
|
return o;
|
|
35
40
|
}
|
|
36
|
-
function p(e,
|
|
37
|
-
return Object.entries(e).reduce((o, [
|
|
41
|
+
function p(e, r) {
|
|
42
|
+
return Object.entries(e).reduce((o, [i, n]) => (o[i] = r(n), o), {});
|
|
38
43
|
}
|
|
39
44
|
export {
|
|
40
|
-
|
|
45
|
+
c as assign,
|
|
41
46
|
s as getter,
|
|
42
47
|
p as mapValues,
|
|
43
|
-
|
|
44
|
-
|
|
48
|
+
l as query,
|
|
49
|
+
y as toAlias
|
|
45
50
|
};
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webpb",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "The webpb runtime library",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "rimraf build/**/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.
|
|
6
|
+
"build": "rimraf build/**/* && tsc && vite build && dts-bundle-generator --config ./dts-bundle-generator.config.cjs && copyfiles ./README.md ./package.json build",
|
|
7
7
|
"check": "npm run lint && npm run test",
|
|
8
8
|
"lint": "eslint --quiet src/**/*.ts",
|
|
9
9
|
"lint:fix": "eslint --fix src/**/*.ts",
|
|
@@ -35,27 +35,27 @@
|
|
|
35
35
|
]
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@eslint/compat": "^
|
|
39
|
-
"@types/node": "^
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
41
|
-
"@typescript-eslint/parser": "^8.
|
|
42
|
-
"@vitest/coverage-v8": "^
|
|
38
|
+
"@eslint/compat": "^2.0.2",
|
|
39
|
+
"@types/node": "^25.1.0",
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "^8.54.0",
|
|
41
|
+
"@typescript-eslint/parser": "^8.54.0",
|
|
42
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
43
43
|
"copyfiles": "^2.4.1",
|
|
44
44
|
"dts-bundle-generator": "^9.5.1",
|
|
45
|
-
"eslint": "^9.
|
|
46
|
-
"eslint-config-prettier": "^
|
|
47
|
-
"eslint-plugin-import": "^2.
|
|
45
|
+
"eslint": "^9.39.2",
|
|
46
|
+
"eslint-config-prettier": "^10.1.8",
|
|
47
|
+
"eslint-plugin-import": "^2.32.0",
|
|
48
48
|
"eslint-plugin-import-quotes": "^0.0.1",
|
|
49
49
|
"eslint-plugin-no-null": "^1.0.2",
|
|
50
|
-
"eslint-plugin-prettier": "^5.
|
|
50
|
+
"eslint-plugin-prettier": "^5.5.5",
|
|
51
51
|
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
52
|
-
"prettier": "^3.
|
|
53
|
-
"pretty-quick": "^4.
|
|
54
|
-
"rimraf": "^6.
|
|
52
|
+
"prettier": "^3.8.1",
|
|
53
|
+
"pretty-quick": "^4.2.2",
|
|
54
|
+
"rimraf": "^6.1.2",
|
|
55
55
|
"ts-node": "^10.9.2",
|
|
56
|
-
"typescript": "^5.
|
|
57
|
-
"typescript-eslint": "^8.
|
|
58
|
-
"vite": "^
|
|
59
|
-
"vitest": "^
|
|
56
|
+
"typescript": "^5.9.3",
|
|
57
|
+
"typescript-eslint": "^8.54.0",
|
|
58
|
+
"vite": "^7.3.1",
|
|
59
|
+
"vitest": "^4.0.18"
|
|
60
60
|
}
|
|
61
61
|
}
|