Version 1
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / fp / _mapping.js
1 /** Used to map aliases to their real names. */
2 exports.aliasToReal = {
3   '__': 'placeholder',
4   'all': 'some',
5   'allPass': 'overEvery',
6   'apply': 'spread',
7   'assoc': 'set',
8   'assocPath': 'set',
9   'compose': 'flowRight',
10   'contains': 'includes',
11   'dissoc': 'unset',
12   'dissocPath': 'unset',
13   'each': 'forEach',
14   'eachRight': 'forEachRight',
15   'equals': 'isEqual',
16   'extend': 'assignIn',
17   'extendWith': 'assignInWith',
18   'first': 'head',
19   'init': 'initial',
20   'mapObj': 'mapValues',
21   'omitAll': 'omit',
22   'nAry': 'ary',
23   'path': 'get',
24   'pathEq': 'matchesProperty',
25   'pathOr': 'getOr',
26   'pickAll': 'pick',
27   'pipe': 'flow',
28   'prop': 'get',
29   'propOf': 'propertyOf',
30   'propOr': 'getOr',
31   'somePass': 'overSome',
32   'unapply': 'rest',
33   'unnest': 'flatten',
34   'useWith': 'overArgs',
35   'whereEq': 'filter',
36   'zipObj': 'zipObject'
37 };
38
39 /** Used to map ary to method names. */
40 exports.aryMethod = {
41   1: [
42       'attempt', 'ceil', 'create', 'curry', 'curryRight', 'floor', 'fromPairs',
43       'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin', 'over',
44       'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
45       'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
46     ],
47   2: [
48       'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
49       'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
50       'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
51       'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
52       'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
53       'findLastKey', 'flatMap', 'forEach', 'forEachRight', 'forIn', 'forInRight',
54       'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn',
55       'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
56       'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
57       'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
58       'omitBy', 'orderBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
59       'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
60       'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
61       'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
62       'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
63       'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
64       'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
65       'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
66       'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
67     ],
68   3: [
69       'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
70       'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
71       'isMatchWith', 'mergeWith', 'pullAllBy', 'reduce', 'reduceRight', 'replace',
72       'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
73       'unionWith', 'xorBy', 'xorWith', 'zipWith'
74     ],
75   4: [
76       'fill', 'setWith'
77     ]
78 };
79
80 /** Used to map ary to rearg configs. */
81 exports.aryRearg = {
82   2: [1, 0],
83   3: [2, 1, 0],
84   4: [3, 2, 0, 1]
85 };
86
87 /** Used to iterate `mapping.aryMethod` keys. */
88 exports.caps = [1, 2, 3, 4];
89
90 /** Used to map method names to their iteratee ary. */
91 exports.iterateeAry = {
92   'assignWith': 2,
93   'assignInWith': 2,
94   'cloneDeepWith': 1,
95   'cloneWith': 1,
96   'dropRightWhile': 1,
97   'dropWhile': 1,
98   'every': 1,
99   'filter': 1,
100   'find': 1,
101   'findIndex': 1,
102   'findKey': 1,
103   'findLast': 1,
104   'findLastIndex': 1,
105   'findLastKey': 1,
106   'flatMap': 1,
107   'forEach': 1,
108   'forEachRight': 1,
109   'forIn': 1,
110   'forInRight': 1,
111   'forOwn': 1,
112   'forOwnRight': 1,
113   'isEqualWith': 2,
114   'isMatchWith': 2,
115   'map': 1,
116   'mapKeys': 1,
117   'mapValues': 1,
118   'partition': 1,
119   'reduce': 2,
120   'reduceRight': 2,
121   'reject': 1,
122   'remove': 1,
123   'some': 1,
124   'takeRightWhile': 1,
125   'takeWhile': 1,
126   'times': 1,
127   'transform': 2
128 };
129
130 /** Used to map method names to iteratee rearg configs. */
131 exports.iterateeRearg = {
132   'findKey': [1],
133   'findLastKey': [1],
134   'mapKeys': [1]
135 };
136
137 /** Used to map method names to rearg configs. */
138 exports.methodRearg = {
139   'assignInWith': [1, 2, 0],
140   'assignWith': [1, 2, 0],
141   'clamp': [2, 0, 1],
142   'mergeWith': [1, 2, 0],
143   'reduce': [2, 0, 1],
144   'reduceRight': [2, 0, 1],
145   'set': [2, 0, 1],
146   'setWith': [3, 1, 2, 0],
147   'slice': [2, 0, 1],
148   'transform': [2, 0, 1]
149 };
150
151 /** Used to map method names to spread configs. */
152 exports.methodSpread = {
153   'partial': 1,
154   'partialRight': 1
155 };
156
157 /** Used to identify methods which mutate arrays or objects. */
158 exports.mutate = {
159   'array': {
160     'fill': true,
161     'pull': true,
162     'pullAll': true,
163     'pullAllBy': true,
164     'pullAt': true,
165     'remove': true,
166     'reverse': true
167   },
168   'object': {
169     'assign': true,
170     'assignIn': true,
171     'assignInWith': true,
172     'assignWith': true,
173     'defaults': true,
174     'defaultsDeep': true,
175     'merge': true,
176     'mergeWith': true
177   },
178   'set': {
179     'set': true,
180     'setWith': true,
181     'unset': true
182   }
183 };
184
185 /** Used to track methods with placeholder support */
186 exports.placeholder = {
187   'bind': true,
188   'bindKey': true,
189   'curry': true,
190   'curryRight': true,
191   'partial': true,
192   'partialRight': true
193 };
194
195 /** Used to map real names to their aliases. */
196 exports.realToAlias = (function() {
197   var hasOwnProperty = Object.prototype.hasOwnProperty,
198       object = exports.aliasToReal,
199       result = {};
200
201   for (var key in object) {
202     var value = object[key];
203     if (hasOwnProperty.call(result, value)) {
204       result[value].push(key);
205     } else {
206       result[value] = [key];
207     }
208   }
209   return result;
210 }());
211
212 /** Used to map method names to other names. */
213 exports.rename = {
214   'curryN': 'curry',
215   'curryRightN': 'curryRight',
216   'getOr': 'get',
217   'trimChars': 'trim',
218   'trimCharsEnd': 'trimEnd',
219   'trimCharsStart': 'trimStart'
220 };
221
222 /** Used to track methods that skip `_.rearg`. */
223 exports.skipRearg = {
224   'add': true,
225   'assign': true,
226   'assignIn': true,
227   'concat': true,
228   'difference': true,
229   'gt': true,
230   'gte': true,
231   'lt': true,
232   'lte': true,
233   'matchesProperty': true,
234   'merge': true,
235   'partial': true,
236   'partialRight': true,
237   'random': true,
238   'range': true,
239   'rangeRight': true,
240   'subtract': true,
241   'zip': true,
242   'zipObject': true
243 };