twice-call-wrapper 1.2.0 → 1.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/index.js +10 -1
- package/package.json +8 -2
package/index.js
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
var composeFunction = require("compose-function")
|
|
2
2
|
var flatmap = require("array.prototype.flatmap")
|
|
3
|
+
var $apply = require("function.apply-x")
|
|
4
|
+
var arrayWrap = require("as-array")
|
|
5
|
+
var times = require("lodash.times")
|
|
6
|
+
var numberTwo = require("es-two")
|
|
7
|
+
var constant = require("literally")
|
|
3
8
|
|
|
4
9
|
module.exports = function twiceCallWrapper(fn) {
|
|
5
|
-
return
|
|
10
|
+
return $apply.call(
|
|
11
|
+
composeFunction,
|
|
12
|
+
require("empty-module"),
|
|
13
|
+
flatmap(arrayWrap(fn), (item) => times(numberTwo, constant(item)))
|
|
14
|
+
)
|
|
6
15
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twice-call-wrapper",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "A small wrapper that calls a function twice: fn(fn(args))",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"function",
|
|
@@ -23,6 +23,12 @@
|
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"array.prototype.flatmap": "^1.3.3",
|
|
26
|
-
"
|
|
26
|
+
"as-array": "^2.0.0",
|
|
27
|
+
"compose-function": "^3.0.3",
|
|
28
|
+
"empty-module": "^0.0.2",
|
|
29
|
+
"es-two": "^1.0.1",
|
|
30
|
+
"function.apply-x": "^1.0.0",
|
|
31
|
+
"literally": "^1.0.0",
|
|
32
|
+
"lodash.times": "^4.3.2"
|
|
27
33
|
}
|
|
28
34
|
}
|