@wzyjs/utils 0.3.31 → 0.3.36

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/web.cjs.js CHANGED
@@ -10861,6 +10861,7 @@ __export(exports_web, {
10861
10861
  getType: () => getType,
10862
10862
  getStrLength: () => getStrLength,
10863
10863
  getSliceStr: () => getSliceStr,
10864
+ getSafeCallbackPath: () => getSafeCallbackPath,
10864
10865
  getRandomString: () => getRandomString,
10865
10866
  getRandomColor: () => getRandomColor,
10866
10867
  getPublicUrl: () => getPublicUrl,
@@ -20350,6 +20351,12 @@ var replaceByVariables = (prompt, variables) => {
20350
20351
  return variables[p1] ?? match;
20351
20352
  });
20352
20353
  };
20354
+ var getSafeCallbackPath = (value, fallback) => {
20355
+ if (!value || !value.startsWith("/") || value.startsWith("//")) {
20356
+ return fallback;
20357
+ }
20358
+ return value;
20359
+ };
20353
20360
  var getType = (value) => {
20354
20361
  return Object.prototype.toString.call(value).slice(8, -1);
20355
20362
  };
package/dist/web.esm.js CHANGED
@@ -20181,6 +20181,12 @@ var replaceByVariables = (prompt, variables) => {
20181
20181
  return variables[p1] ?? match;
20182
20182
  });
20183
20183
  };
20184
+ var getSafeCallbackPath = (value, fallback) => {
20185
+ if (!value || !value.startsWith("/") || value.startsWith("//")) {
20186
+ return fallback;
20187
+ }
20188
+ return value;
20189
+ };
20184
20190
  var getType = (value) => {
20185
20191
  return Object.prototype.toString.call(value).slice(8, -1);
20186
20192
  };
@@ -20620,6 +20626,7 @@ export {
20620
20626
  getType,
20621
20627
  getStrLength,
20622
20628
  getSliceStr,
20629
+ getSafeCallbackPath,
20623
20630
  getRandomString,
20624
20631
  getRandomColor,
20625
20632
  getPublicUrl,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzyjs/utils",
3
- "version": "0.3.31",
3
+ "version": "0.3.36",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "sideEffects": false,
@@ -9,7 +9,8 @@
9
9
  "build-web-cjs": "bun build ./src/web.ts --outfile dist/web.cjs.js --format cjs",
10
10
  "build-node-esm": "bun build ./src/node.ts --outfile dist/node.esm.js --format esm --target node --external nodemailer --external fs-extra --external axios --external node:* --external ali-oss --external nedb --external cheerio --external json5 --external consola --external dayjs --external node-cron --external @aws-sdk/client-s3",
11
11
  "build-node-cjs": "bun build ./src/node.ts --outfile dist/node.cjs.js --format cjs --target node --external nodemailer --external fs-extra --external axios --external node:* --external ali-oss --external nedb --external cheerio --external json5 --external consola --external dayjs --external node-cron --external @aws-sdk/client-s3",
12
- "build": "rm -rf dist && bun run build-web-esm && bun run build-web-cjs && bun run build-node-esm && bun run build-node-cjs && tsc"
12
+ "build": "rm -rf dist && bun run build-web-esm && bun run build-web-cjs && bun run build-node-esm && bun run build-node-cjs && tsc",
13
+ "typecheck": "tsc --noEmit"
13
14
  },
14
15
  "files": [
15
16
  "dist"
@@ -71,7 +72,7 @@
71
72
  "@types/nodemailer": "^6.4.7",
72
73
  "@types/papaparse": "^5.3.15"
73
74
  },
74
- "gitHead": "896e51ffcc433e65605c351be0595918bc32573e",
75
+ "gitHead": "7db0faf741993d729a9e1c0742f480f364816222",
75
76
  "publishConfig": {
76
77
  "access": "public"
77
78
  }