@minto-ai/tools 1.0.1
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/README.md +1335 -0
- package/dist/array/chunk-array.d.ts +12 -0
- package/dist/array/index.d.ts +2 -0
- package/dist/browser/copy-text.d.ts +9 -0
- package/dist/browser/index.d.ts +6 -0
- package/dist/browser/is-android.d.ts +8 -0
- package/dist/browser/is-ios.d.ts +8 -0
- package/dist/browser/is-mobile.d.ts +9 -0
- package/dist/browser/is-pc.d.ts +8 -0
- package/dist/core/__test__/can-be-parsed-as-number.test.d.ts +1 -0
- package/dist/core/be-parsed-as-number.d.ts +8 -0
- package/dist/core/can-be-parsed-as-number.d.ts +8 -0
- package/dist/core/check-array-empty.d.ts +8 -0
- package/dist/core/check-empty-not-zero.d.ts +8 -0
- package/dist/core/check-empty.d.ts +9 -0
- package/dist/core/check-object-empty.d.ts +9 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/is-array.d.ts +8 -0
- package/dist/core/is-null-or-undefined.d.ts +7 -0
- package/dist/core/is-number.d.ts +8 -0
- package/dist/core/is-object.d.ts +8 -0
- package/dist/core/is-string.d.ts +8 -0
- package/dist/core/is-undefined.d.ts +8 -0
- package/dist/file/batch-download-file.d.ts +11 -0
- package/dist/file/extends/enum.d.ts +81 -0
- package/dist/file/extends/regex.d.ts +3 -0
- package/dist/file/get-file-feed-type.d.ts +9 -0
- package/dist/file/get-file-icon.d.ts +8 -0
- package/dist/file/get-file-item-icon.d.ts +9 -0
- package/dist/file/get-file-item-suffix.d.ts +9 -0
- package/dist/file/get-file-name.d.ts +8 -0
- package/dist/file/get-file-suffix-icon.d.ts +9 -0
- package/dist/file/get-file-suffix.d.ts +9 -0
- package/dist/file/get-file-title.d.ts +8 -0
- package/dist/file/index.d.ts +19 -0
- package/dist/file/is-document-file-path.d.ts +8 -0
- package/dist/file/is-file-path.d.ts +8 -0
- package/dist/file/is-image-file-path.d.ts +8 -0
- package/dist/file/is-ppt-file-path.d.ts +8 -0
- package/dist/file/is-video-file-path.d.ts +8 -0
- package/dist/file/single-download-file.d.ts +8 -0
- package/dist/file/types/index.d.ts +18 -0
- package/dist/function/debounce.d.ts +23 -0
- package/dist/function/index.d.ts +3 -0
- package/dist/function/throttle.d.ts +23 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +547 -0
- package/dist/math/__test__/add.test.d.ts +1 -0
- package/dist/math/__test__/divide.test.d.ts +1 -0
- package/dist/math/__test__/get-decimal-places.test.d.ts +1 -0
- package/dist/math/__test__/multiply.test.d.ts +1 -0
- package/dist/math/__test__/subtract.test.d.ts +1 -0
- package/dist/math/add.d.ts +9 -0
- package/dist/math/divide.d.ts +9 -0
- package/dist/math/get-decimal-places.d.ts +8 -0
- package/dist/math/index.d.ts +6 -0
- package/dist/math/multiply.d.ts +9 -0
- package/dist/math/subtract.d.ts +9 -0
- package/dist/object/deep-freeze.d.ts +9 -0
- package/dist/object/index.d.ts +3 -0
- package/dist/object/pick-object.d.ts +9 -0
- package/dist/string/__test__/chunk-string.test.d.ts +1 -0
- package/dist/string/chunk-string.d.ts +10 -0
- package/dist/string/index.d.ts +2 -0
- package/dist/supply/get-uuid.d.ts +9 -0
- package/dist/supply/index.d.ts +2 -0
- package/dist/web-socket/create-web-socket.d.ts +9 -0
- package/dist/web-socket/index.d.ts +3 -0
- package/dist/web-socket/is-web-socket-supported.d.ts +9 -0
- package/dist/wrker/close-worker.d.ts +9 -0
- package/dist/wrker/create-worker.d.ts +11 -0
- package/dist/wrker/index.d.ts +3 -0
- package/package.json +32 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { default as add } from './add';
|
|
2
|
+
import { default as divide } from './divide';
|
|
3
|
+
import { default as getDecimalPlaces } from './get-decimal-places';
|
|
4
|
+
import { default as multiply } from './multiply';
|
|
5
|
+
import { default as subtract } from './subtract';
|
|
6
|
+
export { add, divide, multiply, subtract, getDecimalPlaces };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 从给定对象中挑选指定的属性,并返回一个包含这些属性的新对象。
|
|
3
|
+
*
|
|
4
|
+
* @param obj -源对象,从中挑选属性。
|
|
5
|
+
* @param keys -需要挑选的属性键名数组。
|
|
6
|
+
* @returns 包含指定属性的新对象。
|
|
7
|
+
*/
|
|
8
|
+
declare function pickObject<T extends Record<string, any>, K extends keyof T>(obj: T, keys: K[]): Pick<T, K>;
|
|
9
|
+
export default pickObject;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 将输入字符串按照指定的块大小分割成多个子字符串。
|
|
3
|
+
* 该函数会根据指定的块大小(`chunkSize`)将输入字符串(`str`)分割成多个子字符串,并将这些子字符串存储在一个数组中返回。
|
|
4
|
+
*
|
|
5
|
+
* @param str - 需要分割的原始字符串。
|
|
6
|
+
* @param chunkSize - 每个块的大小,默认为整个字符串的长度。
|
|
7
|
+
* @returns 一个包含分割后的子字符串的数组。
|
|
8
|
+
*/
|
|
9
|
+
declare function chunkString(str: string, chunkSize?: number): string[];
|
|
10
|
+
export default chunkString;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检查当前浏览器是否支持 WebSocket。
|
|
3
|
+
* 此函数检查 'WebSocket' 和 'MozWebSocket' 是否存在于全局 `window` 对象中,
|
|
4
|
+
* 以确定浏览器是否支持 WebSocket。
|
|
5
|
+
*
|
|
6
|
+
* @returns 如果浏览器支持 WebSocket,则返回 `true`;否则返回 `false`。
|
|
7
|
+
*/
|
|
8
|
+
declare function isWebSocketSupported(): boolean;
|
|
9
|
+
export default isWebSocketSupported;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建并返回一个新的 Web Worker 实例。
|
|
3
|
+
* 这个函数接受一个函数,将其转换为字符串,并创建一个 Blob 对象。
|
|
4
|
+
* 然后,它创建一个指向该 Blob 的 URL,并用这个 URL 来创建一个新的 Worker。
|
|
5
|
+
* 最后,释放 URL 对象以供浏览器回收内存。
|
|
6
|
+
*
|
|
7
|
+
* @param fun - 要在 Worker 中执行的 JavaScript 函数。
|
|
8
|
+
* @returns 返回新创建的 Worker 实例。
|
|
9
|
+
*/
|
|
10
|
+
declare function createWorker(fun: (...args: any) => any): Worker;
|
|
11
|
+
export default createWorker;
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@minto-ai/tools",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "明途公共工具库",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ts",
|
|
7
|
+
"tools"
|
|
8
|
+
],
|
|
9
|
+
"author": "hcc",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"publishConfig": {
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"type": "module",
|
|
18
|
+
"module": "./dist/index.js",
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "vite build",
|
|
22
|
+
"up": "gulp --gulpfile ../../gulpfile.cjs --cwd ./"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"axios": "^1.7.9",
|
|
26
|
+
"file-saver": "^2.0.5",
|
|
27
|
+
"jszip": "^3.10.1"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/file-saver": "^2.0.7"
|
|
31
|
+
}
|
|
32
|
+
}
|