@jiakun-zhao/utils 0.0.12 → 0.0.13
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.cjs +5 -5
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,12 +52,12 @@ function filterNotNull() {
|
|
|
52
52
|
function isString(value) {
|
|
53
53
|
return typeof value === "string";
|
|
54
54
|
}
|
|
55
|
-
function it(block) {
|
|
56
|
-
block(
|
|
57
|
-
return
|
|
55
|
+
function it(value, block) {
|
|
56
|
+
block(value);
|
|
57
|
+
return value;
|
|
58
58
|
}
|
|
59
|
-
function to(block) {
|
|
60
|
-
return block(
|
|
59
|
+
function to(value, block) {
|
|
60
|
+
return block(value);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
exports.dist = dist;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ declare function toArray<T>(this: T | T[]): T[];
|
|
|
10
10
|
declare function filterNotNull<T>(this: T[]): NonNullable<T>[];
|
|
11
11
|
|
|
12
12
|
declare function isString(value: any): value is string;
|
|
13
|
-
declare function it<T>(
|
|
14
|
-
declare function to<T, R>(
|
|
13
|
+
declare function it<T>(value: T, block: (i: T) => void): T;
|
|
14
|
+
declare function to<T, R>(value: T, block: (u: T) => R): R;
|
|
15
15
|
|
|
16
16
|
export { dist, filterNotNull, isFileExist, isString, it, readJson, readText, to, toArray, toMD5, writeText };
|
package/dist/index.mjs
CHANGED
|
@@ -45,12 +45,12 @@ function filterNotNull() {
|
|
|
45
45
|
function isString(value) {
|
|
46
46
|
return typeof value === "string";
|
|
47
47
|
}
|
|
48
|
-
function it(block) {
|
|
49
|
-
block(
|
|
50
|
-
return
|
|
48
|
+
function it(value, block) {
|
|
49
|
+
block(value);
|
|
50
|
+
return value;
|
|
51
51
|
}
|
|
52
|
-
function to(block) {
|
|
53
|
-
return block(
|
|
52
|
+
function to(value, block) {
|
|
53
|
+
return block(value);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export { dist, filterNotNull, isFileExist, isString, it, readJson, readText, to, toArray, toMD5, writeText };
|