Add _.eachRight alias of _.forEachRight.

Former-commit-id: ff42b599dd22707fe20ab60a7aff47945b5cef73
This commit is contained in:
John-David Dalton
2013-08-09 23:58:38 -07:00
parent a5cf42b7c8
commit 186f1cf714
8 changed files with 272 additions and 259 deletions

View File

@@ -55,6 +55,7 @@
'detect': 'find',
'drop': 'rest',
'each': 'forEach',
'eachRight': 'forEachRight',
'extend': 'assign',
'findWhere': 'find',
'foldl': 'reduce',
@@ -81,6 +82,7 @@
'find': ['detect', 'findWhere'],
'first': ['head', 'take'],
'forEach': ['each'],
'forEachRight': ['eachRight'],
'functions': ['methods'],
'map': ['collect'],
'reduce': ['foldl', 'inject'],
@@ -4074,9 +4076,9 @@
}
});
// remove `_.assign`, `_.forEachRight`, `_.forIn`, `_.forOwn`, `_.isPlainObject`, `_.unzip`, and `_.zipObject` assignments
// unexpose methods
source = source.replace(getMethodAssignments(source), function(match) {
return _.reduce(['assign', 'createCallback', 'forEachRight', 'forIn', 'forOwn', 'isPlainObject', 'unzip', 'zipObject'], function(result, funcName) {
return _.reduce(['assign', 'createCallback', 'eachRight', 'forEachRight', 'forIn', 'forOwn', 'isPlainObject', 'unzip', 'zipObject'], function(result, funcName) {
return isLodash(funcName)
? result
: result.replace(RegExp('^(?: *//.*\\s*)* *lodash\\.' + funcName + ' *=[\\s\\S]+?;\\n', 'm'), '');