Initial commit
[yaffs-website] / node_modules / grunt-contrib-watch / node_modules / globule / node_modules / lodash / fp / _mapping.js
1 /** Used to map aliases to their real names. */
2 exports.aliasToReal = {
3
4   // Lodash aliases.
5   'each': 'forEach',
6   'eachRight': 'forEachRight',
7   'entries': 'toPairs',
8   'entriesIn': 'toPairsIn',
9   'extend': 'assignIn',
10   'extendAll': 'assignInAll',
11   'extendAllWith': 'assignInAllWith',
12   'extendWith': 'assignInWith',
13   'first': 'head',
14
15   // Methods that are curried variants of others.
16   'conforms': 'conformsTo',
17   'matches': 'isMatch',
18   'property': 'get',
19
20   // Ramda aliases.
21   '__': 'placeholder',
22   'F': 'stubFalse',
23   'T': 'stubTrue',
24   'all': 'every',
25   'allPass': 'overEvery',
26   'always': 'constant',
27   'any': 'some',
28   'anyPass': 'overSome',
29   'apply': 'spread',
30   'assoc': 'set',
31   'assocPath': 'set',
32   'complement': 'negate',
33   'compose': 'flowRight',
34   'contains': 'includes',
35   'dissoc': 'unset',
36   'dissocPath': 'unset',
37   'dropLast': 'dropRight',
38   'dropLastWhile': 'dropRightWhile',
39   'equals': 'isEqual',
40   'identical': 'eq',
41   'indexBy': 'keyBy',
42   'init': 'initial',
43   'invertObj': 'invert',
44   'juxt': 'over',
45   'omitAll': 'omit',
46   'nAry': 'ary',
47   'path': 'get',
48   'pathEq': 'matchesProperty',
49   'pathOr': 'getOr',
50   'paths': 'at',
51   'pickAll': 'pick',
52   'pipe': 'flow',
53   'pluck': 'map',
54   'prop': 'get',
55   'propEq': 'matchesProperty',
56   'propOr': 'getOr',
57   'props': 'at',
58   'symmetricDifference': 'xor',
59   'symmetricDifferenceBy': 'xorBy',
60   'symmetricDifferenceWith': 'xorWith',
61   'takeLast': 'takeRight',
62   'takeLastWhile': 'takeRightWhile',
63   'unapply': 'rest',
64   'unnest': 'flatten',
65   'useWith': 'overArgs',
66   'where': 'conformsTo',
67   'whereEq': 'isMatch',
68   'zipObj': 'zipObject'
69 };
70
71 /** Used to map ary to method names. */
72 exports.aryMethod = {
73   '1': [
74     'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
75     'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
76     'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
77     'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
78     'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
79     'uniqueId', 'words', 'zipAll'
80   ],
81   '2': [
82     'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
83     'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
84     'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
85     'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
86     'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
87     'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
88     'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
89     'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
90     'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
91     'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
92     'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
93     'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
94     'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
95     'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
96     'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
97     'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
98     'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
99     'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
100     'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
101     'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
102     'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
103     'zipObjectDeep'
104   ],
105   '3': [
106     'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
107     'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
108     'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
109     'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
110     'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
111     'padCharsStart', 'pullAllBy', 'pullAllWith', 'rangeStep', 'rangeStepRight',
112     'reduce', 'reduceRight', 'replace', 'set', 'slice', 'sortedIndexBy',
113     'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith', 'update', 'xorBy',
114     'xorWith', 'zipWith'
115   ],
116   '4': [
117     'fill', 'setWith', 'updateWith'
118   ]
119 };
120
121 /** Used to map ary to rearg configs. */
122 exports.aryRearg = {
123   '2': [1, 0],
124   '3': [2, 0, 1],
125   '4': [3, 2, 0, 1]
126 };
127
128 /** Used to map method names to their iteratee ary. */
129 exports.iterateeAry = {
130   'dropRightWhile': 1,
131   'dropWhile': 1,
132   'every': 1,
133   'filter': 1,
134   'find': 1,
135   'findFrom': 1,
136   'findIndex': 1,
137   'findIndexFrom': 1,
138   'findKey': 1,
139   'findLast': 1,
140   'findLastFrom': 1,
141   'findLastIndex': 1,
142   'findLastIndexFrom': 1,
143   'findLastKey': 1,
144   'flatMap': 1,
145   'flatMapDeep': 1,
146   'flatMapDepth': 1,
147   'forEach': 1,
148   'forEachRight': 1,
149   'forIn': 1,
150   'forInRight': 1,
151   'forOwn': 1,
152   'forOwnRight': 1,
153   'map': 1,
154   'mapKeys': 1,
155   'mapValues': 1,
156   'partition': 1,
157   'reduce': 2,
158   'reduceRight': 2,
159   'reject': 1,
160   'remove': 1,
161   'some': 1,
162   'takeRightWhile': 1,
163   'takeWhile': 1,
164   'times': 1,
165   'transform': 2
166 };
167
168 /** Used to map method names to iteratee rearg configs. */
169 exports.iterateeRearg = {
170   'mapKeys': [1]
171 };
172
173 /** Used to map method names to rearg configs. */
174 exports.methodRearg = {
175   'assignInAllWith': [1, 2, 0],
176   'assignInWith': [1, 2, 0],
177   'assignAllWith': [1, 2, 0],
178   'assignWith': [1, 2, 0],
179   'differenceBy': [1, 2, 0],
180   'differenceWith': [1, 2, 0],
181   'getOr': [2, 1, 0],
182   'intersectionBy': [1, 2, 0],
183   'intersectionWith': [1, 2, 0],
184   'isEqualWith': [1, 2, 0],
185   'isMatchWith': [2, 1, 0],
186   'mergeAllWith': [1, 2, 0],
187   'mergeWith': [1, 2, 0],
188   'padChars': [2, 1, 0],
189   'padCharsEnd': [2, 1, 0],
190   'padCharsStart': [2, 1, 0],
191   'pullAllBy': [2, 1, 0],
192   'pullAllWith': [2, 1, 0],
193   'rangeStep': [1, 2, 0],
194   'rangeStepRight': [1, 2, 0],
195   'setWith': [3, 1, 2, 0],
196   'sortedIndexBy': [2, 1, 0],
197   'sortedLastIndexBy': [2, 1, 0],
198   'unionBy': [1, 2, 0],
199   'unionWith': [1, 2, 0],
200   'updateWith': [3, 1, 2, 0],
201   'xorBy': [1, 2, 0],
202   'xorWith': [1, 2, 0],
203   'zipWith': [1, 2, 0]
204 };
205
206 /** Used to map method names to spread configs. */
207 exports.methodSpread = {
208   'assignAll': { 'start': 0 },
209   'assignAllWith': { 'afterRearg': true, 'start': 1 },
210   'assignInAll': { 'start': 0 },
211   'assignInAllWith': { 'afterRearg': true, 'start': 1 },
212   'defaultsAll': { 'start': 0 },
213   'defaultsDeepAll': { 'start': 0 },
214   'invokeArgs': { 'start': 2 },
215   'invokeArgsMap': { 'start': 2 },
216   'mergeAll': { 'start': 0 },
217   'mergeAllWith': { 'afterRearg': true, 'start': 1 },
218   'partial': { 'start': 1 },
219   'partialRight': { 'start': 1 },
220   'without': { 'start': 1 },
221   'zipAll': { 'start': 0 }
222 };
223
224 /** Used to identify methods which mutate arrays or objects. */
225 exports.mutate = {
226   'array': {
227     'fill': true,
228     'pull': true,
229     'pullAll': true,
230     'pullAllBy': true,
231     'pullAllWith': true,
232     'pullAt': true,
233     'remove': true,
234     'reverse': true
235   },
236   'object': {
237     'assign': true,
238     'assignAll': true,
239     'assignAllWith': true,
240     'assignIn': true,
241     'assignInAll': true,
242     'assignInAllWith': true,
243     'assignInWith': true,
244     'assignWith': true,
245     'defaults': true,
246     'defaultsAll': true,
247     'defaultsDeep': true,
248     'defaultsDeepAll': true,
249     'merge': true,
250     'mergeAll': true,
251     'mergeAllWith': true,
252     'mergeWith': true,
253   },
254   'set': {
255     'set': true,
256     'setWith': true,
257     'unset': true,
258     'update': true,
259     'updateWith': true
260   }
261 };
262
263 /** Used to track methods with placeholder support */
264 exports.placeholder = {
265   'bind': true,
266   'bindKey': true,
267   'curry': true,
268   'curryRight': true,
269   'partial': true,
270   'partialRight': true
271 };
272
273 /** Used to map real names to their aliases. */
274 exports.realToAlias = (function() {
275   var hasOwnProperty = Object.prototype.hasOwnProperty,
276       object = exports.aliasToReal,
277       result = {};
278
279   for (var key in object) {
280     var value = object[key];
281     if (hasOwnProperty.call(result, value)) {
282       result[value].push(key);
283     } else {
284       result[value] = [key];
285     }
286   }
287   return result;
288 }());
289
290 /** Used to map method names to other names. */
291 exports.remap = {
292   'assignAll': 'assign',
293   'assignAllWith': 'assignWith',
294   'assignInAll': 'assignIn',
295   'assignInAllWith': 'assignInWith',
296   'curryN': 'curry',
297   'curryRightN': 'curryRight',
298   'defaultsAll': 'defaults',
299   'defaultsDeepAll': 'defaultsDeep',
300   'findFrom': 'find',
301   'findIndexFrom': 'findIndex',
302   'findLastFrom': 'findLast',
303   'findLastIndexFrom': 'findLastIndex',
304   'getOr': 'get',
305   'includesFrom': 'includes',
306   'indexOfFrom': 'indexOf',
307   'invokeArgs': 'invoke',
308   'invokeArgsMap': 'invokeMap',
309   'lastIndexOfFrom': 'lastIndexOf',
310   'mergeAll': 'merge',
311   'mergeAllWith': 'mergeWith',
312   'padChars': 'pad',
313   'padCharsEnd': 'padEnd',
314   'padCharsStart': 'padStart',
315   'propertyOf': 'get',
316   'rangeStep': 'range',
317   'rangeStepRight': 'rangeRight',
318   'restFrom': 'rest',
319   'spreadFrom': 'spread',
320   'trimChars': 'trim',
321   'trimCharsEnd': 'trimEnd',
322   'trimCharsStart': 'trimStart',
323   'zipAll': 'zip'
324 };
325
326 /** Used to track methods that skip fixing their arity. */
327 exports.skipFixed = {
328   'castArray': true,
329   'flow': true,
330   'flowRight': true,
331   'iteratee': true,
332   'mixin': true,
333   'rearg': true,
334   'runInContext': true
335 };
336
337 /** Used to track methods that skip rearranging arguments. */
338 exports.skipRearg = {
339   'add': true,
340   'assign': true,
341   'assignIn': true,
342   'bind': true,
343   'bindKey': true,
344   'concat': true,
345   'difference': true,
346   'divide': true,
347   'eq': true,
348   'gt': true,
349   'gte': true,
350   'isEqual': true,
351   'lt': true,
352   'lte': true,
353   'matchesProperty': true,
354   'merge': true,
355   'multiply': true,
356   'overArgs': true,
357   'partial': true,
358   'partialRight': true,
359   'propertyOf': true,
360   'random': true,
361   'range': true,
362   'rangeRight': true,
363   'subtract': true,
364   'zip': true,
365   'zipObject': true,
366   'zipObjectDeep': true
367 };