@pawover/kit 0.0.0-alpha.18 → 0.0.0-alpha.19

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.
@@ -96,7 +96,7 @@ function objectKeys(obj) {
96
96
  }
97
97
 
98
98
  //#endregion
99
- //#region node_modules/.pnpm/radashi@12.7.0/node_modules/radashi/dist/radashi.js
99
+ //#region node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js
100
100
  function assign(initial, override) {
101
101
  if (!initial || !override) return initial ?? override ?? {};
102
102
  const proto = Object.getPrototypeOf(initial);
@@ -104,58 +104,6 @@ function assign(initial, override) {
104
104
  for (const key of Object.keys(override)) merged[key] = isPlainObject(initial[key]) && isPlainObject(override[key]) ? assign(initial[key], override[key]) : override[key];
105
105
  return merged;
106
106
  }
107
- var QuantityParser = class {
108
- constructor({ units, short }) {
109
- this.units = units;
110
- this.short = short;
111
- }
112
- /**
113
- * Parse a quantity string into its numeric value
114
- *
115
- * @throws {Error} If the quantity string is invalid or contains an unknown unit
116
- */
117
- parse(quantity) {
118
- var _a;
119
- const match = quantity.match(/^(-?\d+(?:\.\d+)?) ?(\w+)?s?$/);
120
- if (!match) throw new Error(`Invalid quantity, cannot parse: ${quantity}`);
121
- let unit = match[2];
122
- unit = ((_a = this.short) == null ? void 0 : _a[unit]) || unit;
123
- const count = Number.parseFloat(match[1]);
124
- if (Math.abs(count) > 1 && unit.endsWith("s")) unit = unit.substring(0, unit.length - 1);
125
- if (!this.units[unit]) throw new Error(`Invalid unit: ${unit}, makes sure it is one of: ${Object.keys(this.units).join(", ")}`);
126
- return count * this.units[unit];
127
- }
128
- };
129
- var _DurationParser = class _DurationParser$1 extends QuantityParser {
130
- constructor(options) {
131
- super({
132
- units: {
133
- ..._DurationParser$1.units,
134
- ...options == null ? void 0 : options.units
135
- },
136
- short: {
137
- ..._DurationParser$1.shortUnits,
138
- ...options == null ? void 0 : options.short
139
- }
140
- });
141
- }
142
- };
143
- _DurationParser.units = {
144
- week: 6048e5,
145
- day: 864e5,
146
- hour: 36e5,
147
- minute: 6e4,
148
- second: 1e3,
149
- millisecond: 1
150
- };
151
- _DurationParser.shortUnits = {
152
- w: "week",
153
- d: "day",
154
- h: "hour",
155
- m: "minute",
156
- s: "second",
157
- ms: "millisecond"
158
- };
159
107
  function isPlainObject(value) {
160
108
  if (typeof value !== "object" || value === null) return false;
161
109
  const prototype = Object.getPrototypeOf(value);
package/dist/index.d.ts CHANGED
@@ -379,33 +379,4 @@ declare function isWebSocket<T extends WebSocket>(value: unknown): value is T;
379
379
  //#region src/utils/typeof/isWindow.d.ts
380
380
  declare function isWindow<T extends Window>(value: unknown): value is T;
381
381
  //#endregion
382
- //#region src/utils/typeof/types.d.ts
383
- declare const prototypeStrings: {
384
- readonly string: "[object String]";
385
- readonly number: "[object Number]";
386
- readonly boolean: "[object Boolean]";
387
- readonly object: "[object Object]";
388
- readonly array: "[object Array]";
389
- readonly bigInt: "[object BigInt]";
390
- readonly symbol: "[object Symbol]";
391
- readonly function: "[object Function]";
392
- readonly generatorFunction: "[object GeneratorFunction]";
393
- readonly asyncFunction: "[object AsyncFunction]";
394
- readonly promise: "[object Promise]";
395
- readonly null: "[object Null]";
396
- readonly undefined: "[object Undefined]";
397
- readonly date: "[object Date]";
398
- readonly regExp: "[object RegExp]";
399
- readonly error: "[object Error]";
400
- readonly file: "[object File]";
401
- readonly map: "[object Map]";
402
- readonly weakMap: "[object WeakMap]";
403
- readonly set: "[object Set]";
404
- readonly weakSet: "[object WeakSet]";
405
- readonly window: "[object Window]";
406
- readonly webSocket: "[object WebSocket]";
407
- readonly URLSearchParams: "[object URLSearchParams]";
408
- };
409
- declare function resolvePrototypeString(value: unknown): string;
410
- //#endregion
411
- export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isArray, isAsyncFunction, isBigInt, isBoolean, isClass, isDate, isEqual, isError, isFile, isFunction, isGeneratorFunction, isInteger, isIterable, isMap, isNull, isNumber, isObject, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, prototypeStrings, resolvePrototypeString, rowsToTree, stringInitialCase, stringReplace, stringToJson, stringToValues, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
382
+ export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isArray, isAsyncFunction, isBigInt, isBoolean, isClass, isDate, isEqual, isError, isFile, isFunction, isGeneratorFunction, isInteger, isIterable, isMap, isNull, isNumber, isObject, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, rowsToTree, stringInitialCase, stringReplace, stringToJson, stringToValues, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
package/dist/index.js CHANGED
@@ -619,7 +619,7 @@ function mapEntries(obj, toEntry) {
619
619
  }
620
620
 
621
621
  //#endregion
622
- //#region node_modules/.pnpm/radashi@12.7.0/node_modules/radashi/dist/radashi.js
622
+ //#region node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js
623
623
  function assign(initial, override) {
624
624
  if (!initial || !override) return initial ?? override ?? {};
625
625
  const proto = Object.getPrototypeOf(initial);
@@ -627,58 +627,6 @@ function assign(initial, override) {
627
627
  for (const key of Object.keys(override)) merged[key] = isPlainObject(initial[key]) && isPlainObject(override[key]) ? assign(initial[key], override[key]) : override[key];
628
628
  return merged;
629
629
  }
630
- var QuantityParser = class {
631
- constructor({ units, short }) {
632
- this.units = units;
633
- this.short = short;
634
- }
635
- /**
636
- * Parse a quantity string into its numeric value
637
- *
638
- * @throws {Error} If the quantity string is invalid or contains an unknown unit
639
- */
640
- parse(quantity) {
641
- var _a;
642
- const match = quantity.match(/^(-?\d+(?:\.\d+)?) ?(\w+)?s?$/);
643
- if (!match) throw new Error(`Invalid quantity, cannot parse: ${quantity}`);
644
- let unit = match[2];
645
- unit = ((_a = this.short) == null ? void 0 : _a[unit]) || unit;
646
- const count = Number.parseFloat(match[1]);
647
- if (Math.abs(count) > 1 && unit.endsWith("s")) unit = unit.substring(0, unit.length - 1);
648
- if (!this.units[unit]) throw new Error(`Invalid unit: ${unit}, makes sure it is one of: ${Object.keys(this.units).join(", ")}`);
649
- return count * this.units[unit];
650
- }
651
- };
652
- var _DurationParser = class _DurationParser$1 extends QuantityParser {
653
- constructor(options) {
654
- super({
655
- units: {
656
- ..._DurationParser$1.units,
657
- ...options == null ? void 0 : options.units
658
- },
659
- short: {
660
- ..._DurationParser$1.shortUnits,
661
- ...options == null ? void 0 : options.short
662
- }
663
- });
664
- }
665
- };
666
- _DurationParser.units = {
667
- week: 6048e5,
668
- day: 864e5,
669
- hour: 36e5,
670
- minute: 6e4,
671
- second: 1e3,
672
- millisecond: 1
673
- };
674
- _DurationParser.shortUnits = {
675
- w: "week",
676
- d: "day",
677
- h: "hour",
678
- m: "minute",
679
- s: "second",
680
- ms: "millisecond"
681
- };
682
630
  function isPlainObject(value) {
683
631
  if (typeof value !== "object" || value === null) return false;
684
632
  const prototype = Object.getPrototypeOf(value);
@@ -1172,4 +1120,4 @@ function treeToRows(tree, options = {}) {
1172
1120
  }
1173
1121
 
1174
1122
  //#endregion
1175
- export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isArray, isAsyncFunction, isBigInt, isBoolean, isClass, isDate, isEqual, isError, isFile, isFunction, isGeneratorFunction, isInteger, isIterable, isMap, isNull, isNumber, isObject, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, prototypeStrings, resolvePrototypeString, rowsToTree, stringInitialCase, stringReplace, stringToJson, stringToValues, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
1123
+ export { arrayCast, arrayCompete, arrayCounting, arrayDifference, arrayFirst, arrayFork, arrayIntersection, arrayLast, arrayMerge, arrayPick, arrayReplace, arraySplit, cloneDeep, enumEntries, enumKeys, enumTypeCheck, enumValues, isArray, isAsyncFunction, isBigInt, isBoolean, isClass, isDate, isEqual, isError, isFile, isFunction, isGeneratorFunction, isInteger, isIterable, isMap, isNull, isNumber, isObject, isPromise, isPromiseLike, isRegExp, isSet, isString, isSymbol, isURLSearchParams, isUndefined, isWeakMap, isWeakSet, isWebSocket, isWindow, mapEntries, objectAssign, objectEntries, objectKeys, objectPick, objectSwitch, objectValues, rowsToTree, stringInitialCase, stringReplace, stringToJson, stringToValues, to, treeFilter, treeFind, treeForEach, treeMap, treeToRows };
package/dist/vite.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { ProxyOptions } from "vite";
2
+
3
+ //#region src/vite/proxy.d.ts
4
+
5
+ /**
6
+ * 开发服务器反向代理配置
7
+ *
8
+ * @param proxyList 代理配置项
9
+ */
10
+ declare function resolveViteProxy<L extends [string, string][]>(proxyList: L): Record<string, ProxyOptions>;
11
+ //#endregion
12
+ export { resolveViteProxy };
package/dist/vite.js ADDED
@@ -0,0 +1,21 @@
1
+ //#region src/vite/proxy.ts
2
+ /**
3
+ * 开发服务器反向代理配置
4
+ *
5
+ * @param proxyList 代理配置项
6
+ */
7
+ function resolveViteProxy(proxyList) {
8
+ const httpsRE = /^https:\/\//;
9
+ const result = {};
10
+ if (typeof proxyList === "object") for (const [prefix, target] of proxyList) result[prefix] = {
11
+ target,
12
+ changeOrigin: true,
13
+ ws: true,
14
+ rewrite: (path) => path.replace(/* @__PURE__ */ new RegExp(`^${prefix}`), ""),
15
+ ...httpsRE.test(target) ? { secure: false } : {}
16
+ };
17
+ return result;
18
+ }
19
+
20
+ //#endregion
21
+ export { resolveViteProxy };
package/metadata.json CHANGED
@@ -53,8 +53,6 @@
53
53
  "objectPick",
54
54
  "objectSwitch",
55
55
  "objectValues",
56
- "prototypeStrings",
57
- "resolvePrototypeString",
58
56
  "rowsToTree",
59
57
  "stringInitialCase",
60
58
  "stringReplace",
@@ -67,6 +65,9 @@
67
65
  "treeMap",
68
66
  "treeToRows"
69
67
  ],
68
+ "vite": [
69
+ "resolveViteProxy"
70
+ ],
70
71
  "zod": [
71
72
  "ID",
72
73
  "IMEI",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "description": "pawover's kit",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "version": "0.0.0-alpha.18",
7
+ "version": "0.0.0-alpha.19",
8
8
  "packageManager": "pnpm@10.20.0",
9
9
  "engines": {
10
10
  "node": ">=22.20.0"
@@ -28,6 +28,7 @@
28
28
  "exports": {
29
29
  ".": "./dist/index.js",
30
30
  "./enums": "./dist/enums.js",
31
+ "./vite": "./dist/vite.js",
31
32
  "./zod": "./dist/zod.js",
32
33
  "./hooks-alova": "./dist/hooks-alova.js",
33
34
  "./hooks-react": "./dist/hooks-react.js",
@@ -50,35 +51,38 @@
50
51
  "lib:up": "taze -I -r --exclude pnpm"
51
52
  },
52
53
  "dependencies": {
53
- "alova": "^3.3.4",
54
- "vue": "^3.5.24",
55
- "zod": "^4.1.12"
54
+ "alova": "^3.4.0",
55
+ "react": "^19.2.0",
56
+ "vite": "^7.2.4",
57
+ "vue": "^3.5.25",
58
+ "zod": "^4.1.13"
56
59
  },
57
60
  "devDependencies": {
58
61
  "@pawover/eslint-rules": "0.0.0-alpha.8",
59
62
  "@pawover/types": "0.0.0-alpha.6",
60
- "@stylistic/eslint-plugin": "^5.5.0",
63
+ "@stylistic/eslint-plugin": "^5.6.1",
61
64
  "@types/fs-extra": "^11.0.4",
62
65
  "@types/node": "^24.10.1",
63
- "@types/react": "^19.2.5",
66
+ "@types/react": "^19.2.7",
64
67
  "eslint": "^9.39.1",
65
68
  "eslint-plugin-antfu": "^3.1.1",
66
69
  "fs-extra": "^11.3.2",
67
70
  "globals": "^16.5.0",
68
- "prettier": "^3.6.2",
69
- "radashi": "^12.7.0",
70
- "rimraf": "^6.1.0",
71
- "taze": "^19.9.0",
72
- "tsdown": "^0.16.5",
71
+ "prettier": "^3.7.3",
72
+ "radashi": "^12.7.1",
73
+ "rimraf": "^6.1.2",
74
+ "taze": "^19.9.2",
75
+ "tsdown": "^0.16.8",
73
76
  "type-fest": "^5.2.0",
74
77
  "typescript": "^5.9.3",
75
- "typescript-eslint": "^8.46.4"
78
+ "typescript-eslint": "^8.48.0"
76
79
  },
77
80
  "peerDependencies": {
78
- "alova": ">=3.3.4",
81
+ "alova": ">=3.3.0",
79
82
  "react": ">=19.2.0",
80
- "vue": ">=3.5.24",
81
- "zod": ">=4.1.12"
83
+ "vite": ">=6.0",
84
+ "vue": ">=3.5.0",
85
+ "zod": ">=4.1.0"
82
86
  },
83
87
  "peerDependenciesMeta": {
84
88
  "alova": {
@@ -87,6 +91,9 @@
87
91
  "react": {
88
92
  "optional": true
89
93
  },
94
+ "vite": {
95
+ "optional": true
96
+ },
90
97
  "vue": {
91
98
  "optional": true
92
99
  },