@vope/utils 1.6.0 → 1.6.2

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.d.ts CHANGED
@@ -5,6 +5,7 @@ export { deepWeakEqual } from './compare/weak-equal';
5
5
  export { hash8json } from './convert/json';
6
6
  export { hash8object } from './convert/object';
7
7
  export { hash8strings } from './convert/strings';
8
+ export { weekDic, default_max_second, default_min_second, default_max_minute, default_min_minute, default_max_hour, default_min_hour, default_max_day, default_min_day, default_max_month, default_min_month, default_max_week, default_min_week, createCronRegexText, InvalidValue, isInvalidValue, DayLastValue, isDayLastValue, WeekLastValue, isWeekLastValue, WildcardValue, isWildcardValue, RangeValue, isRangeValue, DigitsValue, isDigitsValue, Cron } from './cron';
8
9
  export { type DesensDecrypt, type DesensEncrypt, desensEncrypt, desensDecrypt, desensReplace } from './desens';
9
10
  export { getEncoding } from './encoding';
10
11
  export { inputRegex } from './input-regex';
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ import { deepWeakEqual } from "./compare/weak-equal";
5
5
  import { hash8json } from "./convert/json";
6
6
  import { hash8object } from "./convert/object";
7
7
  import { hash8strings } from "./convert/strings";
8
+ import { weekDic, default_max_second, default_min_second, default_max_minute, default_min_minute, default_max_hour, default_min_hour, default_max_day, default_min_day, default_max_month, default_min_month, default_max_week, default_min_week, createCronRegexText, InvalidValue, isInvalidValue, DayLastValue, isDayLastValue, WeekLastValue, isWeekLastValue, WildcardValue, isWildcardValue, RangeValue, isRangeValue, DigitsValue, isDigitsValue, Cron } from "./cron";
8
9
  import { desensEncrypt, desensDecrypt, desensReplace } from "./desens";
9
10
  import { getEncoding } from "./encoding";
10
11
  import { inputRegex } from "./input-regex";
@@ -33,23 +34,43 @@ import { joinPaths } from "./url/join";
33
34
  import { connectURLParams } from "./url/params";
34
35
  import { wait } from "./wait";
35
36
  export {
37
+ Cron,
38
+ DayLastValue,
39
+ DigitsValue,
36
40
  FlexTable,
41
+ InvalidValue,
37
42
  MemoryBasic,
38
43
  MemoryList,
39
44
  MemoryPower,
40
45
  MemorySimple,
41
46
  default3 as Neo4j,
42
47
  default2 as Neo4jAhchors,
48
+ RangeValue,
43
49
  default4 as Subscriber,
44
50
  Union,
51
+ WeekLastValue,
52
+ WildcardValue,
45
53
  clamp,
46
54
  classnames,
47
55
  compareVersion,
48
56
  connectURLParams,
57
+ createCronRegexText,
49
58
  css,
50
59
  cubeURLParams,
51
60
  deconPowersSum,
52
61
  deepWeakEqual,
62
+ default_max_day,
63
+ default_max_hour,
64
+ default_max_minute,
65
+ default_max_month,
66
+ default_max_second,
67
+ default_max_week,
68
+ default_min_day,
69
+ default_min_hour,
70
+ default_min_minute,
71
+ default_min_month,
72
+ default_min_second,
73
+ default_min_week,
53
74
  desensDecrypt,
54
75
  desensEncrypt,
55
76
  desensReplace,
@@ -60,14 +81,21 @@ export {
60
81
  hash8strings,
61
82
  inputRegex,
62
83
  isClass,
84
+ isDayLastValue,
85
+ isDigitsValue,
63
86
  isEmpty,
87
+ isInvalidValue,
64
88
  isKey,
65
89
  isNull,
90
+ isRangeValue,
91
+ isWeekLastValue,
92
+ isWildcardValue,
66
93
  joinPaths,
67
94
  loadImage,
68
95
  once,
69
96
  parseNum,
70
97
  rotateAngle,
71
98
  rotateRad,
72
- wait
99
+ wait,
100
+ weekDic
73
101
  };
@@ -4,5 +4,6 @@ import { Serializes } from '../serialize/url-params';
4
4
  * @param url
5
5
  * @param params 需要让url携带的参数
6
6
  * @param serializes 转换套件
7
+ * @description 未设置转换套件时使用URLSearchParams的默认处理方式
7
8
  */
8
- export declare const connectURLParams: <T extends object>(url: string, params: T, serializes: Serializes<T>) => string;
9
+ export declare const connectURLParams: <T extends object>(url: string, params: T, serializes?: Serializes<T>) => string;
@@ -1,6 +1,16 @@
1
1
  import { flatURLParams } from "../serialize/url-params";
2
+ const rasterize = (data) => {
3
+ const params = new URLSearchParams();
4
+ for (const key in data) {
5
+ params.append(
6
+ key,
7
+ data[key]
8
+ );
9
+ }
10
+ return params.toString();
11
+ };
2
12
  const connectURLParams = (url, params, serializes) => {
3
- const query = flatURLParams(params, serializes);
13
+ const query = serializes ? flatURLParams(params, serializes) : rasterize(params);
4
14
  return query ? url.includes("?") ? url + "&" + query : url + "?" + query : url;
5
15
  };
6
16
  export {
package/package.json CHANGED
@@ -1,81 +1,81 @@
1
- {
2
- "name": "@vope/utils",
3
- "version": "1.6.0",
4
- "description": "",
5
- "publishConfig": {
6
- "access": "public",
7
- "registry": "https://registry.npmjs.org/"
8
- },
9
- "types": "./dist/index.d.ts",
10
- "typings": "./dist/index.d.ts",
11
- "module": "./dist/index.js",
12
- "main": "./dist/index.js",
13
- "scripts": {
14
- "start": "esbuild ./start.ts --outfile=start.cjs --format=cjs & node ./start.cjs",
15
- "poststart": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
16
- "build": "npm run start & node ./build.cjs",
17
- "premocha": "node ./build.cjs --type=test",
18
- "mocha": "mocha __tests/**/*.js",
19
- "test": "npm run mocha",
20
- "prepublishOnly": "npm run build & npm run test",
21
- "debug": "npm run start & npm run premocha",
22
- "clean": "rimraf start.cjs pre.cjs build.cjs src/index.ts dist/ __tests/ __examples/ sub_storage/"
23
- },
24
- "exports": {
25
- ".": {
26
- "types": "./dist/index.d.ts",
27
- "import": "./dist/index.js",
28
- "require": "./dist/index.cjs.js"
29
- },
30
- "./storage": {
31
- "types": "./sub_storage/offline.d.ts",
32
- "import": "./sub_storage/offline.js",
33
- "require": "./sub_storage/offline.cjs.js"
34
- }
35
- },
36
- "author": "vope",
37
- "license": "ISC",
38
- "files": [
39
- "dist",
40
- "sub_storage"
41
- ],
42
- "devDependencies": {
43
- "@babel/parser": "^7.26.9",
44
- "@babel/traverse": "^7.26.9",
45
- "@babel/types": "^7.26.9",
46
- "@rollup/plugin-alias": "^5.1.1",
47
- "@rollup/plugin-commonjs": "^28.0.2",
48
- "@rollup/plugin-json": "^6.1.0",
49
- "@rollup/plugin-node-resolve": "^16.0.0",
50
- "@rollup/plugin-typescript": "^12.1.2",
51
- "@types/babel__traverse": "^7.20.6",
52
- "@types/mocha": "^10.0.6",
53
- "@types/node": "^22.13.5",
54
- "@types/sm-crypto": "^0.3.4",
55
- "esbuild": "^0.25.0",
56
- "glob": "^11.0.1",
57
- "iconv-lite": "^0.6.3",
58
- "mocha": "^10.2.0",
59
- "puppeteer": "^24.3.0",
60
- "rimraf": "^5.0.5",
61
- "rollup": "^4.34.8",
62
- "tslib": "^2.8.1",
63
- "typescript": "^5.7.3",
64
- "uuid": "^11.1.0"
65
- },
66
- "dependencies": {
67
- "@type-challenges/utils": "^0.1.1",
68
- "@types/lodash-es": "^4.17.12",
69
- "@vope/types": "^1.1.1",
70
- "csstype": "^3.1.3",
71
- "localforage": "^1.10.0",
72
- "lodash-es": "^4.17.21",
73
- "sm-crypto": "^0.3.13"
74
- },
75
- "pnpm": {
76
- "onlyBuiltDependencies": [
77
- "esbuild",
78
- "puppeteer"
79
- ]
80
- }
81
- }
1
+ {
2
+ "name": "@vope/utils",
3
+ "version": "1.6.2",
4
+ "description": "",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
9
+ "types": "./dist/index.d.ts",
10
+ "typings": "./dist/index.d.ts",
11
+ "module": "./dist/index.js",
12
+ "main": "./dist/index.js",
13
+ "scripts": {
14
+ "start": "esbuild ./start.ts --outfile=start.cjs --format=cjs & node ./start.cjs",
15
+ "poststart": "esbuild ./pre.ts --outfile=pre.cjs --format=cjs & node ./pre.cjs",
16
+ "build": "npm run start & node ./build.cjs",
17
+ "premocha": "node ./build.cjs --type=test",
18
+ "mocha": "mocha __tests/**/*.js",
19
+ "test": "npm run mocha",
20
+ "prepublishOnly": "npm run build & npm run test",
21
+ "debug": "npm run start & npm run premocha",
22
+ "clean": "rimraf start.cjs pre.cjs build.cjs src/index.ts dist/ __tests/ __examples/ sub_storage/"
23
+ },
24
+ "exports": {
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js",
28
+ "require": "./dist/index.cjs.js"
29
+ },
30
+ "./storage": {
31
+ "types": "./sub_storage/offline.d.ts",
32
+ "import": "./sub_storage/offline.js",
33
+ "require": "./sub_storage/offline.cjs.js"
34
+ }
35
+ },
36
+ "author": "vope",
37
+ "license": "ISC",
38
+ "files": [
39
+ "dist",
40
+ "sub_storage"
41
+ ],
42
+ "devDependencies": {
43
+ "@babel/parser": "^7.26.9",
44
+ "@babel/traverse": "^7.26.9",
45
+ "@babel/types": "^7.26.9",
46
+ "@rollup/plugin-alias": "^5.1.1",
47
+ "@rollup/plugin-commonjs": "^28.0.2",
48
+ "@rollup/plugin-json": "^6.1.0",
49
+ "@rollup/plugin-node-resolve": "^16.0.0",
50
+ "@rollup/plugin-typescript": "^12.1.2",
51
+ "@types/babel__traverse": "^7.20.6",
52
+ "@types/mocha": "^10.0.6",
53
+ "@types/node": "^22.13.5",
54
+ "@types/sm-crypto": "^0.3.4",
55
+ "esbuild": "^0.25.0",
56
+ "glob": "^11.0.1",
57
+ "iconv-lite": "^0.6.3",
58
+ "mocha": "^10.2.0",
59
+ "puppeteer": "^24.3.0",
60
+ "rimraf": "^5.0.5",
61
+ "rollup": "^4.34.8",
62
+ "tslib": "^2.8.1",
63
+ "typescript": "^5.7.3",
64
+ "uuid": "^11.1.0"
65
+ },
66
+ "dependencies": {
67
+ "@type-challenges/utils": "^0.1.1",
68
+ "@types/lodash-es": "^4.17.12",
69
+ "@vope/types": "^1.1.1",
70
+ "csstype": "^3.1.3",
71
+ "localforage": "^1.10.0",
72
+ "lodash-es": "^4.17.21",
73
+ "sm-crypto": "^0.3.13"
74
+ },
75
+ "pnpm": {
76
+ "onlyBuiltDependencies": [
77
+ "esbuild",
78
+ "puppeteer"
79
+ ]
80
+ }
81
+ }