@minto-ai/tools 1.0.46 → 1.0.48

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.
@@ -2,13 +2,13 @@
2
2
  * 文件后缀类型枚举
3
3
  */
4
4
  declare const FileSuffixEnum: {
5
- readonly DOC: "doc";
6
5
  readonly DOCX: "docx";
6
+ readonly DOC: "doc";
7
7
  readonly PDF: "pdf";
8
- readonly PPT: "ppt";
9
8
  readonly PPTX: "pptx";
10
- readonly XLS: "xls";
9
+ readonly PPT: "ppt";
11
10
  readonly XLSX: "xlsx";
11
+ readonly XLS: "xls";
12
12
  readonly JPG: "jpg";
13
13
  readonly PNG: "png";
14
14
  readonly JPEG: "jpeg";
package/dist/index.d.ts CHANGED
@@ -7,5 +7,6 @@ export * from './math';
7
7
  export * from './object';
8
8
  export * from './string';
9
9
  export * from './supply';
10
+ export * from './validator';
10
11
  export * from './web-socket';
11
12
  export * from './wrker';
package/dist/index.js CHANGED
@@ -13185,13 +13185,13 @@ function objectToQueryString(obj) {
13185
13185
  }).join("&");
13186
13186
  }
13187
13187
  var FileSuffixEnum = {
13188
- DOC: "doc",
13189
13188
  DOCX: "docx",
13189
+ DOC: "doc",
13190
13190
  PDF: "pdf",
13191
- PPT: "ppt",
13192
13191
  PPTX: "pptx",
13193
- XLS: "xls",
13192
+ PPT: "ppt",
13194
13193
  XLSX: "xlsx",
13194
+ XLS: "xls",
13195
13195
  JPG: "jpg",
13196
13196
  PNG: "png",
13197
13197
  JPEG: "jpeg",
@@ -13644,6 +13644,13 @@ function timeDelay(delay) {
13644
13644
  setTimeout(resolve2, delay);
13645
13645
  });
13646
13646
  }
13647
+ function isValidUrl(url) {
13648
+ if (!isString(url)) {
13649
+ return false;
13650
+ }
13651
+ var urlPattern = /^https?:\/\/(?:[\w-]+:[\w-]+@)?(?:localhost|(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,}|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d))(?::\d{1,5})?(?:\/[^\s?#]*)?(?:\?[^\s#]*)?(?:#\S*)?$/i;
13652
+ return urlPattern.test(url.trim());
13653
+ }
13647
13654
  function createWebSocket(url) {
13648
13655
  return new WebSocket(url);
13649
13656
  }
@@ -13708,6 +13715,7 @@ export {
13708
13715
  isPptFilePath,
13709
13716
  isString,
13710
13717
  isUndefined,
13718
+ isValidUrl,
13711
13719
  isVideoFilePath,
13712
13720
  isWebSocketSupported,
13713
13721
  multiply2 as multiply,
@@ -0,0 +1,2 @@
1
+ import { default as isValidUrl } from './is-valid-url';
2
+ export { isValidUrl, };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 检查给定的URL是否符合标准网页地址格式。
3
+ * @param url - 需要验证的URL字符串。
4
+ * @returns 如果URL格式合格,返回true;否则返回false。
5
+ */
6
+ export declare function isValidUrl(url: string): boolean;
7
+ export default isValidUrl;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@minto-ai/tools",
3
3
  "type": "module",
4
- "version": "1.0.46",
4
+ "version": "1.0.48",
5
5
  "description": "明途公共工具库",
6
6
  "author": "hcc",
7
7
  "license": "ISC",