webpb 0.0.23 → 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 CHANGED
@@ -1 +1 @@
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;
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 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);
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 l(e, t) {
6
+ function s(e, r) {
7
7
  if (e == null || typeof e != "object")
8
8
  return null;
9
- for (const o of t.split("."))
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 y(e, t) {
15
- const o = [];
16
- for (const [r, n] of Object.entries(t)) {
17
- if (n == null || typeof n == "function")
18
- continue;
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}`);
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 j(e, t) {
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 [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;
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, t) {
37
- return Object.entries(e).reduce((o, [r, n]) => (o[r] = t(n), 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
- s as assign,
41
- l as getter,
45
+ c as assign,
46
+ s as getter,
42
47
  p as mapValues,
43
- y as query,
44
- j as toAlias
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.23",
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.ts && copyfiles ./README.md ./package.json build",
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": "^1.2.4",
39
- "@types/node": "^22.10.2",
40
- "@typescript-eslint/eslint-plugin": "^8.18.2",
41
- "@typescript-eslint/parser": "^8.18.2",
42
- "@vitest/coverage-v8": "^2.1.8",
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.17.0",
46
- "eslint-config-prettier": "^9.1.0",
47
- "eslint-plugin-import": "^2.31.0",
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.2.1",
50
+ "eslint-plugin-prettier": "^5.5.5",
51
51
  "eslint-plugin-sort-keys-fix": "^1.1.2",
52
- "prettier": "^3.4.2",
53
- "pretty-quick": "^4.0.0",
54
- "rimraf": "^6.0.1",
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.7.2",
57
- "typescript-eslint": "^8.18.2",
58
- "vite": "^6.0.5",
59
- "vitest": "^2.1.8"
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
  }