Built motion from commit fd239ea.|0.0.31
[motion.git] / public / bower_components / lodash / dist / lodash.fp.js
1 (function webpackUniversalModuleDefinition(root, factory) {
2         if(typeof exports === 'object' && typeof module === 'object')
3                 module.exports = factory();
4         else if(typeof define === 'function' && define.amd)
5                 define([], factory);
6         else if(typeof exports === 'object')
7                 exports["fp"] = factory();
8         else
9                 root["fp"] = factory();
10 })(this, function() {
11 return /******/ (function(modules) { // webpackBootstrap
12 /******/        // The module cache
13 /******/        var installedModules = {};
14
15 /******/        // The require function
16 /******/        function __webpack_require__(moduleId) {
17
18 /******/                // Check if module is in cache
19 /******/                if(installedModules[moduleId])
20 /******/                        return installedModules[moduleId].exports;
21
22 /******/                // Create a new module (and put it into the cache)
23 /******/                var module = installedModules[moduleId] = {
24 /******/                        exports: {},
25 /******/                        id: moduleId,
26 /******/                        loaded: false
27 /******/                };
28
29 /******/                // Execute the module function
30 /******/                modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32 /******/                // Flag the module as loaded
33 /******/                module.loaded = true;
34
35 /******/                // Return the exports of the module
36 /******/                return module.exports;
37 /******/        }
38
39
40 /******/        // expose the modules object (__webpack_modules__)
41 /******/        __webpack_require__.m = modules;
42
43 /******/        // expose the module cache
44 /******/        __webpack_require__.c = installedModules;
45
46 /******/        // __webpack_public_path__
47 /******/        __webpack_require__.p = "";
48
49 /******/        // Load entry module and return exports
50 /******/        return __webpack_require__(0);
51 /******/ })
52 /************************************************************************/
53 /******/ ([
54 /* 0 */
55 /***/ function(module, exports, __webpack_require__) {
56
57         var baseConvert = __webpack_require__(1);
58
59         /**
60          * Converts `lodash` to an auto-curried iteratee-first data-last version.
61          *
62          * @param {Function} lodash The lodash function.
63          * @returns {Function} Returns the converted lodash function.
64          */
65         function browserConvert(lodash) {
66           return baseConvert(lodash, lodash);
67         }
68
69         module.exports = browserConvert;
70
71
72 /***/ },
73 /* 1 */
74 /***/ function(module, exports, __webpack_require__) {
75
76         var mapping = __webpack_require__(2),
77             mutateMap = mapping.mutateMap;
78
79         /**
80          * The base implementation of `convert` which accepts a `util` object of methods
81          * required to perform conversions.
82          *
83          * @param {Object} util The util object.
84          * @param {string} name The name of the function to wrap.
85          * @param {Function} func The function to wrap.
86          * @returns {Function|Object} Returns the converted function or object.
87          */
88         function baseConvert(util, name, func) {
89           if (typeof func != 'function') {
90             func = name;
91             name = undefined;
92           }
93           if (func == null) {
94             throw new TypeError;
95           }
96           var isLib = name === undefined && typeof func.VERSION == 'string';
97
98           var _ = isLib ? func : {
99             'ary': util.ary,
100             'cloneDeep': util.cloneDeep,
101             'curry': util.curry,
102             'forEach': util.forEach,
103             'isFunction': util.isFunction,
104             'iteratee': util.iteratee,
105             'keys': util.keys,
106             'rearg': util.rearg
107           };
108
109           var ary = _.ary,
110               cloneDeep = _.cloneDeep,
111               curry = _.curry,
112               each = _.forEach,
113               isFunction = _.isFunction,
114               keys = _.keys,
115               rearg = _.rearg;
116
117           var baseAry = function(func, n) {
118             return function() {
119               var args = arguments,
120                   length = Math.min(args.length, n);
121
122               switch (length) {
123                 case 1: return func(args[0]);
124                 case 2: return func(args[0], args[1]);
125               }
126               args = Array(length);
127               while (length--) {
128                 args[length] = arguments[length];
129               }
130               return func.apply(undefined, args);
131             };
132           };
133
134           var cloneArray = function(array) {
135             var length = array ? array.length : 0,
136                 result = Array(length);
137
138             while (length--) {
139               result[length] = array[length];
140             }
141             return result;
142           };
143
144           var createCloner = function(func) {
145             return function(object) {
146               return func({}, object);
147             };
148           };
149
150           var immutWrap = function(func, cloner) {
151             return overArg(func, cloner, true);
152           };
153
154           var iterateeAry = function(func, n) {
155             return overArg(func, function(func) {
156               return baseAry(func, n);
157             });
158           };
159
160           var overArg = function(func, iteratee, retArg) {
161             return function() {
162               var length = arguments.length,
163                   args = Array(length);
164
165               while (length--) {
166                 args[length] = arguments[length];
167               }
168               args[0] = iteratee(args[0]);
169               var result = func.apply(undefined, args);
170               return retArg ? args[0] : result;
171             };
172           };
173
174           var wrappers = {
175             'iteratee': function(iteratee) {
176               return function(func, arity) {
177                 arity = arity > 2 ? (arity - 2) : 1;
178                 func = iteratee(func);
179                 var length = func.length;
180                 return (length && length <= arity) ? func : baseAry(func, arity);
181               };
182             },
183             'mixin': function(mixin) {
184               return function(source) {
185                 var func = this;
186                 if (!isFunction(func)) {
187                   return mixin(func, Object(source));
188                 }
189                 var methods = [],
190                     methodNames = [];
191
192                 each(keys(source), function(key) {
193                   var value = source[key];
194                   if (isFunction(value)) {
195                     methodNames.push(key);
196                     methods.push(func.prototype[key]);
197                   }
198                 });
199
200                 mixin(func, Object(source));
201
202                 each(methodNames, function(methodName, index) {
203                   var method = methods[index];
204                   if (isFunction(method)) {
205                     func.prototype[methodName] = method;
206                   } else {
207                     delete func.prototype[methodName];
208                   }
209                 });
210                 return func;
211               };
212             },
213             'runInContext': function(runInContext) {
214               return function(context) {
215                 return baseConvert(util, runInContext(context));
216               };
217             }
218           };
219
220           var wrap = function(name, func) {
221             var wrapper = wrappers[name];
222             if (wrapper) {
223               return wrapper(func);
224             }
225             if (mutateMap.array[name]) {
226               func = immutWrap(func, cloneArray);
227             }
228             else if (mutateMap.object[name]) {
229               func = immutWrap(func, createCloner(func));
230             }
231             else if (mutateMap.set[name]) {
232               func = immutWrap(func, cloneDeep);
233             }
234             var result;
235             each(mapping.caps, function(cap) {
236               each(mapping.aryMethodMap[cap], function(otherName) {
237                 if (name == otherName) {
238                   result = ary(func, cap);
239                   if (cap > 1 && !mapping.skipReargMap[name]) {
240                     result = rearg(result, mapping.methodReargMap[name] || mapping.aryReargMap[cap]);
241                   }
242                   var n = !isLib && mapping.aryIterateeMap[name];
243                   if (n) {
244                     result = iterateeAry(result, n);
245                   }
246                   if (cap > 1) {
247                     result = curry(result, cap);
248                   }
249                   return false;
250                 }
251               });
252               return !result;
253             });
254             return result || func;
255           };
256
257           if (!isLib) {
258             return wrap(name, func);
259           }
260           // Iterate over methods for the current ary cap.
261           var pairs = [];
262           each(mapping.caps, function(cap) {
263             each(mapping.aryMethodMap[cap], function(key) {
264               var func = _[mapping.keyMap[key] || key];
265               if (func) {
266                 pairs.push([key, wrap(key, func)]);
267               }
268             });
269           });
270
271           // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
272           each(pairs, function(pair) {
273             _[pair[0]] = pair[1];
274           });
275
276           // Wrap the lodash method and its aliases.
277           each(keys(_), function(key) {
278             each(mapping.aliasMap[key] || [], function(alias) {
279               _[alias] = _[key];
280             });
281           });
282
283           return _;
284         }
285
286         module.exports = baseConvert;
287
288
289 /***/ },
290 /* 2 */
291 /***/ function(module, exports) {
292
293         module.exports = {
294
295           /** Used to map method names to their aliases. */
296           'aliasMap': {
297             'ary': ['nAry'],
298             'overEvery': ['allPass'],
299             'overSome': ['somePass'],
300             'filter': ['whereEq'],
301             'flatten': ['unnest'],
302             'flow': ['pipe'],
303             'flowRight': ['compose'],
304             'forEach': ['each'],
305             'forEachRight': ['eachRight'],
306             'get': ['path'],
307             'getOr': ['pathOr'],
308             'head': ['first'],
309             'includes': ['contains'],
310             'initial': ['init'],
311             'isEqual': ['equals'],
312             'mapValues': ['mapObj'],
313             'matchesProperty': ['pathEq'],
314             'overArgs': ['useWith'],
315             'omit': ['dissoc', 'omitAll'],
316             'pick': ['pickAll'],
317             'property': ['prop'],
318             'propertyOf': ['propOf'],
319             'rest': ['unapply'],
320             'some': ['all'],
321             'spread': ['apply'],
322             'zipObject': ['zipObj']
323           },
324
325           /** Used to map method names to their iteratee ary. */
326           'aryIterateeMap': {
327             'assignWith': 2,
328             'cloneDeepWith': 1,
329             'cloneWith': 1,
330             'dropRightWhile': 1,
331             'dropWhile': 1,
332             'every': 1,
333             'extendWith': 2,
334             'filter': 1,
335             'find': 1,
336             'findIndex': 1,
337             'findKey': 1,
338             'findLast': 1,
339             'findLastIndex': 1,
340             'findLastKey': 1,
341             'flatMap': 1,
342             'forEach': 1,
343             'forEachRight': 1,
344             'forIn': 1,
345             'forInRight': 1,
346             'forOwn': 1,
347             'forOwnRight': 1,
348             'isEqualWith': 2,
349             'isMatchWith': 2,
350             'map': 1,
351             'mapKeys': 1,
352             'mapValues': 1,
353             'partition': 1,
354             'reduce': 2,
355             'reduceRight': 2,
356             'reject': 1,
357             'remove': 1,
358             'some': 1,
359             'takeRightWhile': 1,
360             'takeWhile': 1,
361             'times': 1,
362             'transform': 2
363           },
364
365           /** Used to map ary to method names. */
366           'aryMethodMap': {
367             1: (
368               'attempt,ceil,create,curry,curryRight,floor,fromPairs,iteratee,invert,over,' +
369               'overEvery,overSome,memoize,method,methodOf,mixin,rest,reverse,round,' +
370               'runInContext,template,trim,trimLeft,trimRight,uniqueId,words').split(','),
371             2: (
372               'add,ary,assign,at,bind,bindKey,cloneDeepWith,cloneWith,concat,countBy,curryN,' +
373               'curryRightN,debounce,defaults,defaultsDeep,delay,difference,drop,dropRight,' +
374               'dropRightWhile,dropWhile,endsWith,eq,every,extend,filter,find,find,findIndex,' +
375               'findKey,findLast,findLastIndex,findLastKey,flatMap,forEach,forEachRight,' +
376               'forIn,forInRight,forOwn,forOwnRight,get,groupBy,includes,indexBy,indexOf,' +
377               'intersection,invoke,invokeMap,isMatch,lastIndexOf,map,mapKeys,mapValues,' +
378               'matchesProperty,maxBy,mean,minBy,merge,omit,orderBy,overArgs,pad,padLeft,' +
379               'padRight,parseInt,partition,pick,pull,pullAll,pullAt,random,range,rangeRight,' +
380               'rearg,reject,remove,repeat,result,sampleSize,some,sortBy,sortedIndexBy,' +
381               'sortedLastIndexBy,sortedUniqBy,startsWith,subtract,sumBy,take,takeRight,' +
382               'takeRightWhile,takeWhile,throttle,times,truncate,union,uniqBy,without,wrap,' +
383               'xor,zip,zipObject').split(','),
384             3: (
385               'assignWith,clamp,differenceBy,extendWith,getOr,inRange,intersectionBy,' +
386               'isEqualWith,isMatchWith,mergeWith,omitBy,pickBy,pullAllBy,reduce,' +
387               'reduceRight,set,slice,transform,unionBy,xorBy,zipWith').split(','),
388             4:
389               ['fill', 'setWith']
390           },
391
392           /** Used to map ary to rearg configs by method ary. */
393           'aryReargMap': {
394             2: [1, 0],
395             3: [2, 1, 0],
396             4: [3, 2, 0, 1]
397           },
398
399           /** Used to map ary to rearg configs by method names. */
400           'methodReargMap': {
401             'clamp': [2, 0, 1],
402             'reduce': [2, 0, 1],
403             'reduceRight': [2, 0, 1],
404             'setWith': [3, 2, 1, 0],
405             'slice': [2, 0, 1],
406             'transform': [2, 0, 1]
407           },
408
409           /** Used to iterate `mapping.aryMethodMap` keys. */
410           'caps': [1, 2, 3, 4],
411
412           /** Used to map keys to other keys. */
413           'keyMap': {
414             'curryN': 'curry',
415             'curryRightN': 'curryRight',
416             'getOr': 'get'
417           },
418
419           /** Used to identify methods which mutate arrays or objects. */
420           'mutateMap': {
421             'array': {
422               'fill': true,
423               'pull': true,
424               'pullAll': true,
425               'pullAllBy': true,
426               'pullAt': true,
427               'remove': true,
428               'reverse': true
429             },
430             'object': {
431               'assign': true,
432               'assignWith': true,
433               'defaults': true,
434               'defaultsDeep': true,
435               'extend': true,
436               'extendWith': true,
437               'merge': true,
438               'mergeWith': true
439             },
440             'set': {
441               'set': true,
442               'setWith': true
443             }
444           },
445
446           /** Used to track methods that skip `_.rearg`. */
447           'skipReargMap': {
448             'difference': true,
449             'matchesProperty': true,
450             'random': true,
451             'range': true,
452             'rangeRight': true,
453             'zip': true,
454             'zipObject': true
455           }
456         };
457
458
459 /***/ }
460 /******/ ])
461 });
462 ;