Add ramda aliases to fp mapping.

This commit is contained in:
John-David Dalton
2015-10-26 21:20:49 -07:00
parent c360ee0fa4
commit 6b2645b310

View File

@@ -2,9 +2,35 @@ module.exports = {
/** Used to map method names to their aliases. */
'aliasMap': {
'ary': ['nAry'],
'conj': ['allPass'],
'disj': ['somePass'],
'filter': ['whereEq'],
'flatten': ['unnest'],
'flow': ['pipe'],
'flowRight': ['compose'],
'forEach': ['each'],
'forEachRight': ['eachRight'],
'head': ['first']
'get': ['path'],
'getOr': ['pathOr'],
'head': ['first'],
'includes': ['contains'],
'initial': ['init'],
'isEqual': ['equals'],
'mapValues': ['mapObj'],
'matchesProperty': ['pathEq'],
'modArgs': ['useWith'],
'modArgsSet': ['converge'],
'omit': ['dissoc', 'omitAll'],
'pairs': ['toPairs'],
'pairsIn': ['toPairsIn'],
'pick': ['pickAll'],
'property': ['prop'],
'propertyOf': ['propOf'],
'rest': ['unapply'],
'some': ['all'],
'spread': ['apply'],
'zipObject': ['zipObj']
},
/** Used to map method names to their iteratee ary. */
@@ -49,25 +75,26 @@ module.exports = {
/** Used to map ary to method names. */
'aryMethodMap': {
1: (
'attempt,ceil,create,curry,floor,iteratee,invert,memoize,method,methodOf,' +
'mixin,rest,reverse,round,runInContext,template,trim,trimLeft,trimRight,' +
'words,zipObject').split(','),
'attempt,ceil,create,curry,floor,fromPairs,iteratee,invert,memoize,method,' +
'methodOf,mixin,rest,reverse,round,runInContext,template,trim,trimLeft,' +
'trimRight,words').split(','),
2: (
'ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,countBy,curryN,debounce,' +
'defaults,defaultsDeep,delay,difference,drop,dropRight,dropRightWhile,' +
'dropWhile,endsWith,every,extend,filter,find,find,findIndex,findKey,findLast,' +
'findLastIndex,findLastKey,forEach,forEachRight,forIn,forInRight,forOwn,' +
'forOwnRight,get,groupBy,includes,indexBy,indexOf,intersection,invoke,' +
'isMatch,lastIndexOf,map,mapKeys,mapValues,maxBy,minBy,merge,modArgs,' +
'modArgsSet,omit,pad,padLeft,padRight,parseInt,partition,pick,pull,pullAll,' +
'pullAt,random,range,rearg,reject,remove,repeat,result,sampleSize,set,some,' +
'sortBy,sortByOrder,sortedIndexBy,sortedLastIndexBy,sortedUniqBy,startsWith,' +
'sumBy,take,takeRight,takeRightWhile,takeWhile,throttle,times,truncate,' +
'union,uniqBy,uniqueId,without,wrap,xor,zip').split(','),
'dropWhile,endsWith,every,extend,filter,find,find,findIndex,findKey,' +
'findLast,findLastIndex,findLastKey,forEach,forEachRight,forIn,forInRight,' +
'forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,intersection,' +
'invoke,isMatch,lastIndexOf,map,mapKeys,mapValues,matchesProperty,maxBy,' +
'minBy,merge,modArgs,modArgsSet,omit,pad,padLeft,padRight,parseInt,partition,' +
'pick,pull,pullAll,pullAt,random,range,rearg,reject,remove,repeat,result,' +
'sampleSize,set,some,sortBy,sortByOrder,sortedIndexBy,sortedLastIndexBy,' +
'sortedUniqBy,startsWith,sumBy,take,takeRight,takeRightWhile,takeWhile,' +
'throttle,times,truncate,union,uniqBy,uniqueId,without,wrap,xor,zip,' +
'zipObject').split(','),
3: (
'assignWith,clamp,differenceBy,extendWith,inRange,intersectionBy,isEqualWith,' +
'isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,reduceRight,slice,' +
'transform,unionBy,xorBy,zipWith').split(','),
'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' +
'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' +
'reduceRight,slice,transform,unionBy,xorBy,zipWith').split(','),
4:
['fill']
},
@@ -96,6 +123,8 @@ module.exports = {
'curryN': 'curry',
'curryRightN': 'curryRight',
'debounceOpt': 'debounce',
'fromPairs': 'zipObject',
'getOr': 'get',
'throttleOpt': 'throttle'
},
@@ -125,6 +154,7 @@ module.exports = {
/** Used to track methods that skip `_.rearg`. */
'skipReargMap': {
'difference': true,
'matchesProperty': true,
'random': true,
'range': true,
'zipObject': true