@aomex/internal-tools 3.1.1 → 3.2.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/CHANGELOG.md +16 -0
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.2.1](https://github.com/aomex/aomex/compare/v3.2.0...v3.2.1) (2024-09-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @aomex/internal-tools
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [3.2.0](https://github.com/aomex/aomex/compare/v3.1.1...v3.2.0) (2024-09-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @aomex/internal-tools
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [3.1.1](https://github.com/aomex/aomex/compare/v3.1.0...v3.1.1) (2024-09-13)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @aomex/internal-tools
|
package/dist/index.js
CHANGED
|
@@ -4,9 +4,10 @@ function toArray(data, unique = false) {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
// src/sleep.ts
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
import timers from "node:timers/promises";
|
|
8
|
+
var sleep = (durationMS) => {
|
|
9
|
+
return durationMS <= 0 ? Promise.resolve(void 0) : timers.setTimeout(durationMS);
|
|
10
|
+
};
|
|
10
11
|
|
|
11
12
|
// src/index.ts
|
|
12
13
|
import { default as default2 } from "bytes";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/to-array.ts","../src/sleep.ts","../src/index.ts"],"sourcesContent":["/**\n * 返回数组,如果传入非数组,则会包装成只有一个元素的数组\n * @param data 非数组或者数组\n * @param unique 是否需要去重。默认:`false`\n */\nexport function toArray<T>(data: T | readonly T[], unique?: boolean): T[];\nexport function toArray<T>(data: T | T[], unique?: boolean): T[];\nexport function toArray<T>(data: T | T[], unique: boolean = false): T[] {\n return Array.isArray(data) ? (unique ? [...new Set(data)] : data) : [data];\n}\n","/**\n * 等待指定的时间(毫秒)后再往下执行\n */\nexport const sleep = (durationMS: number): Promise<void>
|
|
1
|
+
{"version":3,"sources":["../src/to-array.ts","../src/sleep.ts","../src/index.ts"],"sourcesContent":["/**\n * 返回数组,如果传入非数组,则会包装成只有一个元素的数组\n * @param data 非数组或者数组\n * @param unique 是否需要去重。默认:`false`\n */\nexport function toArray<T>(data: T | readonly T[], unique?: boolean): T[];\nexport function toArray<T>(data: T | T[], unique?: boolean): T[];\nexport function toArray<T>(data: T | T[], unique: boolean = false): T[] {\n return Array.isArray(data) ? (unique ? [...new Set(data)] : data) : [data];\n}\n","import timers from 'node:timers/promises';\n\n/**\n * 等待指定的时间(毫秒)后再往下执行\n */\nexport const sleep = (durationMS: number): Promise<void> => {\n return durationMS <= 0 ? Promise.resolve(void 0) : timers.setTimeout(durationMS);\n};\n","export * from './to-array';\nexport * from './sleep';\nexport * from './type';\nexport { default as bytes } from 'bytes';\n"],"mappings":";AAOO,SAAS,QAAW,MAAe,SAAkB,OAAY;AACtE,SAAO,MAAM,QAAQ,IAAI,IAAK,SAAS,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC,IAAI,OAAQ,CAAC,IAAI;AAC3E;;;ACTA,OAAO,YAAY;AAKZ,IAAM,QAAQ,CAAC,eAAsC;AAC1D,SAAO,cAAc,IAAI,QAAQ,QAAQ,MAAM,IAAI,OAAO,WAAW,UAAU;AACjF;;;ACJA,SAAoB,WAAXA,gBAAwB;","names":["default"]}
|