@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 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(this);
57
- return this;
55
+ function it(value, block) {
56
+ block(value);
57
+ return value;
58
58
  }
59
- function to(block) {
60
- return block(this);
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>(this: T, block: (it: T) => void): T;
14
- declare function to<T, R>(this: T, block: (it: T) => R): 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(this);
50
- return this;
48
+ function it(value, block) {
49
+ block(value);
50
+ return value;
51
51
  }
52
- function to(block) {
53
- return block(this);
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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jiakun-zhao/utils",
3
3
  "type": "module",
4
- "version": "0.0.12",
4
+ "version": "0.0.13",
5
5
  "description": "Utils.",
6
6
  "author": "Jiakun Zhao <jiakun.zhao@outlook.com>",
7
7
  "license": "MIT",