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)
6 else if(typeof exports === 'object')
7 exports["fp"] = factory();
9 root["fp"] = factory();
11 return /******/ (function(modules) { // webpackBootstrap
12 /******/ // The module cache
13 /******/ var installedModules = {};
15 /******/ // The require function
16 /******/ function __webpack_require__(moduleId) {
18 /******/ // Check if module is in cache
19 /******/ if(installedModules[moduleId])
20 /******/ return installedModules[moduleId].exports;
22 /******/ // Create a new module (and put it into the cache)
23 /******/ var module = installedModules[moduleId] = {
25 /******/ id: moduleId,
26 /******/ loaded: false
29 /******/ // Execute the module function
30 /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
32 /******/ // Flag the module as loaded
33 /******/ module.loaded = true;
35 /******/ // Return the exports of the module
36 /******/ return module.exports;
40 /******/ // expose the modules object (__webpack_modules__)
41 /******/ __webpack_require__.m = modules;
43 /******/ // expose the module cache
44 /******/ __webpack_require__.c = installedModules;
46 /******/ // __webpack_public_path__
47 /******/ __webpack_require__.p = "";
49 /******/ // Load entry module and return exports
50 /******/ return __webpack_require__(0);
52 /************************************************************************/
55 /***/ function(module, exports, __webpack_require__) {
57 var baseConvert = __webpack_require__(1);
60 * Converts `lodash` to an immutable auto-curried iteratee-first data-last
61 * version with conversion `options` applied.
63 * @param {Function} lodash The lodash function to convert.
64 * @param {Object} [options] The options object. See `baseConvert` for more details.
65 * @returns {Function} Returns the converted `lodash`.
67 function browserConvert(lodash, options) {
68 return baseConvert(lodash, lodash, options);
71 if (typeof _ == 'function') {
72 _ = browserConvert(_.runInContext());
74 module.exports = browserConvert;
79 /***/ function(module, exports, __webpack_require__) {
81 var mapping = __webpack_require__(2),
82 mutateMap = mapping.mutate,
83 fallbackHolder = __webpack_require__(3);
86 * Creates a function, with an arity of `n`, that invokes `func` with the
87 * arguments it receives.
90 * @param {Function} func The function to wrap.
91 * @param {number} n The arity of the new function.
92 * @returns {Function} Returns the new function.
94 function baseArity(func, n) {
96 ? function(a, b) { return func.apply(undefined, arguments); }
97 : function(a) { return func.apply(undefined, arguments); };
101 * Creates a function that invokes `func`, with up to `n` arguments, ignoring
102 * any additional arguments.
105 * @param {Function} func The function to cap arguments for.
106 * @param {number} n The arity cap.
107 * @returns {Function} Returns the new function.
109 function baseAry(func, n) {
111 ? function(a, b) { return func(a, b); }
112 : function(a) { return func(a); };
116 * Creates a clone of `array`.
119 * @param {Array} array The array to clone.
120 * @returns {Array} Returns the cloned array.
122 function cloneArray(array) {
123 var length = array ? array.length : 0,
124 result = Array(length);
127 result[length] = array[length];
133 * Creates a function that clones a given object using the assignment `func`.
136 * @param {Function} func The assignment function.
137 * @returns {Function} Returns the new cloner function.
139 function createCloner(func) {
140 return function(object) {
141 return func({}, object);
146 * Creates a function that wraps `func` and uses `cloner` to clone the first
147 * argument it receives.
150 * @param {Function} func The function to wrap.
151 * @param {Function} cloner The function to clone arguments.
152 * @returns {Function} Returns the new immutable function.
154 function immutWrap(func, cloner) {
156 var length = arguments.length;
160 var args = Array(length);
162 args[length] = arguments[length];
164 var result = args[0] = cloner.apply(undefined, args);
165 func.apply(undefined, args);
171 * The base implementation of `convert` which accepts a `util` object of methods
172 * required to perform conversions.
174 * @param {Object} util The util object.
175 * @param {string} name The name of the function to convert.
176 * @param {Function} func The function to convert.
177 * @param {Object} [options] The options object.
178 * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
179 * @param {boolean} [options.curry=true] Specify currying.
180 * @param {boolean} [options.fixed=true] Specify fixed arity.
181 * @param {boolean} [options.immutable=true] Specify immutable operations.
182 * @param {boolean} [options.rearg=true] Specify rearranging arguments.
183 * @returns {Function|Object} Returns the converted function or object.
185 function baseConvert(util, name, func, options) {
187 isLib = typeof name == 'function',
188 isObj = name === Object(name);
198 options || (options = {});
201 'cap': 'cap' in options ? options.cap : true,
202 'curry': 'curry' in options ? options.curry : true,
203 'fixed': 'fixed' in options ? options.fixed : true,
204 'immutable': 'immutable' in options ? options.immutable : true,
205 'rearg': 'rearg' in options ? options.rearg : true
208 var forceCurry = ('curry' in options) && options.curry,
209 forceFixed = ('fixed' in options) && options.fixed,
210 forceRearg = ('rearg' in options) && options.rearg,
211 placeholder = isLib ? func : fallbackHolder,
212 pristine = isLib ? func.runInContext() : undefined;
214 var helpers = isLib ? func : {
216 'assign': util.assign,
219 'forEach': util.forEach,
220 'isArray': util.isArray,
221 'isFunction': util.isFunction,
222 'iteratee': util.iteratee,
225 'spread': util.spread,
226 'toPath': util.toPath
229 var ary = helpers.ary,
230 assign = helpers.assign,
231 clone = helpers.clone,
232 curry = helpers.curry,
233 each = helpers.forEach,
234 isArray = helpers.isArray,
235 isFunction = helpers.isFunction,
237 rearg = helpers.rearg,
238 spread = helpers.spread,
239 toPath = helpers.toPath;
241 var aryMethodKeys = keys(mapping.aryMethod);
244 'castArray': function(castArray) {
246 var value = arguments[0];
247 return isArray(value)
248 ? castArray(cloneArray(value))
249 : castArray.apply(undefined, arguments);
252 'iteratee': function(iteratee) {
254 var func = arguments[0],
255 arity = arguments[1],
256 result = iteratee(func, arity),
257 length = result.length;
259 if (config.cap && typeof arity == 'number') {
260 arity = arity > 2 ? (arity - 2) : 1;
261 return (length && length <= arity) ? result : baseAry(result, arity);
266 'mixin': function(mixin) {
267 return function(source) {
269 if (!isFunction(func)) {
270 return mixin(func, Object(source));
275 each(keys(source), function(key) {
276 var value = source[key];
277 if (isFunction(value)) {
278 methodNames.push(key);
279 methods.push(func.prototype[key]);
283 mixin(func, Object(source));
285 each(methodNames, function(methodName, index) {
286 var method = methods[index];
287 if (isFunction(method)) {
288 func.prototype[methodName] = method;
290 delete func.prototype[methodName];
296 'runInContext': function(runInContext) {
297 return function(context) {
298 return baseConvert(util, runInContext(context), options);
303 /*--------------------------------------------------------------------------*/
306 * Creates a clone of `object` by `path`.
309 * @param {Object} object The object to clone.
310 * @param {Array|string} path The path to clone by.
311 * @returns {Object} Returns the cloned object.
313 function cloneByPath(object, path) {
317 length = path.length,
318 result = clone(Object(object)),
321 while (nested != null && ++index < length) {
322 var key = path[index],
326 nested[key] = clone(Object(value));
328 nested = nested[key];
334 * Converts `lodash` to an immutable auto-curried iteratee-first data-last
335 * version with conversion `options` applied.
337 * @param {Object} [options] The options object. See `baseConvert` for more details.
338 * @returns {Function} Returns the converted `lodash`.
340 function convertLib(options) {
341 return _.runInContext.convert(options)(undefined);
345 * Create a converter function for `func` of `name`.
347 * @param {string} name The name of the function to convert.
348 * @param {Function} func The function to convert.
349 * @returns {Function} Returns the new converter function.
351 function createConverter(name, func) {
352 var oldOptions = options;
353 return function(options) {
354 var newUtil = isLib ? pristine : helpers,
355 newFunc = isLib ? pristine[name] : func,
356 newOptions = assign(assign({}, oldOptions), options);
358 return baseConvert(newUtil, name, newFunc, newOptions);
363 * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
364 * arguments, ignoring any additional arguments.
367 * @param {Function} func The function to cap iteratee arguments for.
368 * @param {number} n The arity cap.
369 * @returns {Function} Returns the new function.
371 function iterateeAry(func, n) {
372 return overArg(func, function(func) {
373 return typeof func == 'function' ? baseAry(func, n) : func;
378 * Creates a function that wraps `func` to invoke its iteratee with arguments
379 * arranged according to the specified `indexes` where the argument value at
380 * the first index is provided as the first argument, the argument value at
381 * the second index is provided as the second argument, and so on.
384 * @param {Function} func The function to rearrange iteratee arguments for.
385 * @param {number[]} indexes The arranged argument indexes.
386 * @returns {Function} Returns the new function.
388 function iterateeRearg(func, indexes) {
389 return overArg(func, function(func) {
390 var n = indexes.length;
391 return baseArity(rearg(baseAry(func, n), indexes), n);
396 * Creates a function that invokes `func` with its first argument passed
400 * @param {Function} func The function to wrap.
401 * @param {...Function} transform The functions to transform the first argument.
402 * @returns {Function} Returns the new function.
404 function overArg(func, transform) {
406 var length = arguments.length;
410 var args = Array(length);
412 args[length] = arguments[length];
414 var index = config.rearg ? 0 : (length - 1);
415 args[index] = transform(args[index]);
416 return func.apply(undefined, args);
421 * Creates a function that wraps `func` and applys the conversions
425 * @param {string} name The name of the function to wrap.
426 * @param {Function} func The function to wrap.
427 * @returns {Function} Returns the converted function.
429 function wrap(name, func) {
430 name = mapping.aliasToReal[name] || name;
434 wrapper = wrappers[name];
437 wrapped = wrapper(func);
439 else if (config.immutable) {
440 if (mutateMap.array[name]) {
441 wrapped = immutWrap(func, cloneArray);
443 else if (mutateMap.object[name]) {
444 wrapped = immutWrap(func, createCloner(func));
446 else if (mutateMap.set[name]) {
447 wrapped = immutWrap(func, cloneByPath);
450 each(aryMethodKeys, function(aryKey) {
451 each(mapping.aryMethod[aryKey], function(otherName) {
452 if (name == otherName) {
453 var aryN = !isLib && mapping.iterateeAry[name],
454 reargIndexes = mapping.iterateeRearg[name],
455 spreadStart = mapping.methodSpread[name];
458 if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
459 result = spreadStart === undefined
460 ? ary(result, aryKey)
461 : spread(result, spreadStart);
463 if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
464 result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
468 result = iterateeRearg(result, reargIndexes);
470 result = iterateeAry(result, aryN);
473 if (forceCurry || (config.curry && aryKey > 1)) {
474 forceCurry && console.log(forceCurry, name);
475 result = curry(result, aryKey);
483 result || (result = wrapped);
484 if (result == func) {
485 result = forceCurry ? curry(result, 1) : function() {
486 return func.apply(this, arguments);
489 result.convert = createConverter(name, func);
490 if (mapping.placeholder[name]) {
491 setPlaceholder = true;
492 result.placeholder = func.placeholder = placeholder;
497 /*--------------------------------------------------------------------------*/
500 return wrap(name, func);
504 // Convert methods by ary cap.
506 each(aryMethodKeys, function(aryKey) {
507 each(mapping.aryMethod[aryKey], function(key) {
508 var func = _[mapping.remap[key] || key];
510 pairs.push([key, wrap(key, func)]);
515 // Convert remaining methods.
516 each(keys(_), function(key) {
518 if (typeof func == 'function') {
519 var length = pairs.length;
521 if (pairs[length][0] == key) {
525 func.convert = createConverter(key, func);
526 pairs.push([key, func]);
530 // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
531 each(pairs, function(pair) {
532 _[pair[0]] = pair[1];
535 _.convert = convertLib;
536 if (setPlaceholder) {
537 _.placeholder = placeholder;
540 each(keys(_), function(key) {
541 each(mapping.realToAlias[key] || [], function(alias) {
549 module.exports = baseConvert;
554 /***/ function(module, exports) {
556 /** Used to map aliases to their real names. */
557 exports.aliasToReal = {
561 'eachRight': 'forEachRight',
562 'entries': 'toPairs',
563 'entriesIn': 'toPairsIn',
564 'extend': 'assignIn',
565 'extendWith': 'assignInWith',
571 'allPass': 'overEvery',
572 'always': 'constant',
574 'anyPass': 'overSome',
578 'complement': 'negate',
579 'compose': 'flowRight',
580 'contains': 'includes',
582 'dissocPath': 'unset',
586 'invertObj': 'invert',
591 'pathEq': 'matchesProperty',
598 'propEq': 'matchesProperty',
603 'useWith': 'overArgs',
605 'zipObj': 'zipObject'
608 /** Used to map ary to method names. */
609 exports.aryMethod = {
611 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
612 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
613 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
614 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
618 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
619 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
620 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
621 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
622 'eq', 'every', 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast',
623 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
624 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
625 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
626 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
627 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
628 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
629 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
630 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
631 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
632 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
633 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
634 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
635 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
636 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
637 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
641 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
642 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'invokeArgs',
643 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth', 'mergeWith',
644 'orderBy', 'padChars', 'padCharsEnd', 'padCharsStart', 'pullAllBy',
645 'pullAllWith', 'reduce', 'reduceRight', 'replace', 'set', 'slice',
646 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy', 'unionWith',
647 'update', 'xorBy', 'xorWith', 'zipWith'
650 'fill', 'setWith', 'updateWith'
654 /** Used to map ary to rearg configs. */
661 /** Used to map method names to their iteratee ary. */
662 exports.iterateeAry = {
697 /** Used to map method names to iteratee rearg configs. */
698 exports.iterateeRearg = {
702 /** Used to map method names to rearg configs. */
703 exports.methodRearg = {
704 'assignInWith': [1, 2, 0],
705 'assignWith': [1, 2, 0],
707 'isEqualWith': [1, 2, 0],
708 'isMatchWith': [2, 1, 0],
709 'mergeWith': [1, 2, 0],
710 'padChars': [2, 1, 0],
711 'padCharsEnd': [2, 1, 0],
712 'padCharsStart': [2, 1, 0],
713 'pullAllBy': [2, 1, 0],
714 'pullAllWith': [2, 1, 0],
715 'setWith': [3, 1, 2, 0],
716 'sortedIndexBy': [2, 1, 0],
717 'sortedLastIndexBy': [2, 1, 0],
718 'updateWith': [3, 1, 2, 0],
722 /** Used to map method names to spread configs. */
723 exports.methodSpread = {
731 /** Used to identify methods which mutate arrays or objects. */
746 'assignInWith': true,
749 'defaultsDeep': true,
762 /** Used to track methods with placeholder support */
763 exports.placeholder = {
772 /** Used to map real names to their aliases. */
773 exports.realToAlias = (function() {
774 var hasOwnProperty = Object.prototype.hasOwnProperty,
775 object = exports.aliasToReal,
778 for (var key in object) {
779 var value = object[key];
780 if (hasOwnProperty.call(result, value)) {
781 result[value].push(key);
783 result[value] = [key];
789 /** Used to map method names to other names. */
792 'curryRightN': 'curryRight',
794 'invokeArgs': 'invoke',
795 'invokeArgsMap': 'invokeMap',
797 'padCharsEnd': 'padEnd',
798 'padCharsStart': 'padStart',
800 'spreadFrom': 'spread',
802 'trimCharsEnd': 'trimEnd',
803 'trimCharsStart': 'trimStart'
806 /** Used to track methods that skip fixing their arity. */
807 exports.skipFixed = {
816 /** Used to track methods that skip rearranging arguments. */
817 exports.skipRearg = {
832 'matchesProperty': true,
837 'partialRight': true,
850 /***/ function(module, exports) {
853 * The default argument placeholder value for methods.