thaw 2.1.3 → 2.1.5
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.js +0 -14
- package/package.json +9 -10
package/dist/index.js
CHANGED
|
@@ -2,45 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.throttle = exports.debounce = exports.compose = exports.before = exports.around = exports.after = void 0;
|
|
5
|
-
|
|
6
5
|
const around = (fn, cb) => {
|
|
7
6
|
return (...args) => {
|
|
8
7
|
return cb(fn(cb(...args)));
|
|
9
8
|
};
|
|
10
9
|
};
|
|
11
|
-
|
|
12
10
|
exports.around = around;
|
|
13
|
-
|
|
14
11
|
const after = (fn, cb) => {
|
|
15
12
|
return (...args) => {
|
|
16
13
|
return cb(fn(...args));
|
|
17
14
|
};
|
|
18
15
|
};
|
|
19
|
-
|
|
20
16
|
exports.after = after;
|
|
21
|
-
|
|
22
17
|
const before = (fn, cb) => {
|
|
23
18
|
return (...args) => {
|
|
24
19
|
return fn(cb(...args));
|
|
25
20
|
};
|
|
26
21
|
};
|
|
27
|
-
|
|
28
22
|
exports.before = before;
|
|
29
|
-
|
|
30
23
|
const compose = (...fns) => {
|
|
31
24
|
return (...args) => {
|
|
32
25
|
let result = null;
|
|
33
|
-
|
|
34
26
|
for (let i = 0; i < fns.length; i++) {
|
|
35
27
|
result = fns[i](...(i ? [result] : args));
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
return result;
|
|
39
30
|
};
|
|
40
31
|
};
|
|
41
|
-
|
|
42
32
|
exports.compose = compose;
|
|
43
|
-
|
|
44
33
|
const debounce = (fn, wait = 0) => {
|
|
45
34
|
let tick;
|
|
46
35
|
return (...args) => {
|
|
@@ -50,9 +39,7 @@ const debounce = (fn, wait = 0) => {
|
|
|
50
39
|
}, wait);
|
|
51
40
|
};
|
|
52
41
|
};
|
|
53
|
-
|
|
54
42
|
exports.debounce = debounce;
|
|
55
|
-
|
|
56
43
|
const throttle = (fn, wait = 0) => {
|
|
57
44
|
let tick;
|
|
58
45
|
return (...args) => {
|
|
@@ -62,5 +49,4 @@ const throttle = (fn, wait = 0) => {
|
|
|
62
49
|
}, wait);
|
|
63
50
|
};
|
|
64
51
|
};
|
|
65
|
-
|
|
66
52
|
exports.throttle = throttle;
|
package/package.json
CHANGED
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"url": "https://github.com/bricss/thaw/issues"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@babel/cli": "^7.
|
|
12
|
-
"@babel/core": "^7.
|
|
13
|
-
"@babel/eslint-parser": "^7.
|
|
14
|
-
"@babel/preset-env": "^7.
|
|
15
|
-
"c8": "^7.
|
|
16
|
-
"eslint": "^8.
|
|
17
|
-
"eslint-config-ultra-refined": "^2.
|
|
18
|
-
"mocha": "^10.
|
|
11
|
+
"@babel/cli": "^7.19.3",
|
|
12
|
+
"@babel/core": "^7.20.2",
|
|
13
|
+
"@babel/eslint-parser": "^7.19.1",
|
|
14
|
+
"@babel/preset-env": "^7.20.2",
|
|
15
|
+
"c8": "^7.12.0",
|
|
16
|
+
"eslint": "^8.27.0",
|
|
17
|
+
"eslint-config-ultra-refined": "^2.10.0",
|
|
18
|
+
"mocha": "^10.1.0"
|
|
19
19
|
},
|
|
20
20
|
"description": "The narrow belt for AOP 🎀",
|
|
21
21
|
"engines": {
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"aspect-oriented"
|
|
37
37
|
],
|
|
38
38
|
"license": "MIT",
|
|
39
|
-
"main": "./dist/index.js",
|
|
40
39
|
"name": "thaw",
|
|
41
40
|
"repository": {
|
|
42
41
|
"type": "git",
|
|
@@ -50,5 +49,5 @@
|
|
|
50
49
|
"test": "mocha --exit --recursive",
|
|
51
50
|
"test:cover": "c8 --include=src --reporter=lcov --reporter=text npm test"
|
|
52
51
|
},
|
|
53
|
-
"version": "2.1.
|
|
52
|
+
"version": "2.1.5"
|
|
54
53
|
}
|