Skip to content

Commit b61eea9

Browse files
committed
fix: correct mapCall implementation
1 parent b349401 commit b61eea9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "src/index.js",
66
"scripts": {
77
"pretest": "standard",
8+
"lint-fix": "standard --fix",
89
"test": "./node_modules/mocha/bin/mocha spec/*.spec.js",
910
"coverage": "nyc npm test",
1011
"release": "standard-version"

src/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ function applyWhen (fn, args) {
6666
}
6767
}
6868

69-
function bindAll(obj) {
70-
const names = Object.getOwnPropertyNames(obj.prototype);
69+
function bindAll (obj) {
70+
const names = Object.getOwnPropertyNames(obj.prototype)
7171
names.forEach(name => {
72-
const prop = obj.prototype[ name ];
72+
const prop = obj.prototype[ name ]
7373
if (typeof prop === 'function') {
74-
obj[ prop ] = obj.prop.bind( obj );
74+
obj[ prop ] = obj.prop.bind(obj)
7575
}
76-
});
76+
})
7777
}
7878

7979
function clone (source, target) {
@@ -261,7 +261,7 @@ function mapCall (method, map) {
261261
} else {
262262
return function (actor, message) {
263263
let appliedArgs = [ actor ]
264-
argumentList.each((arg) => {
264+
argumentList.forEach((arg) => {
265265
appliedArgs.push(message[ arg ])
266266
})
267267
return method.apply(undefined, appliedArgs)
@@ -405,6 +405,7 @@ function without (a, b) {
405405
module.exports = {
406406
any: any,
407407
applyWhen: applyWhen,
408+
bindAll: bindAll,
408409
contains: contains,
409410
clone: clone,
410411
defaults: defaults,

0 commit comments

Comments
 (0)