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));
273 each(keys(source), function(key) {
274 if (isFunction(source[key])) {
275 pairs.push([key, func.prototype[key]]);
279 mixin(func, Object(source));
281 each(pairs, function(pair) {
283 if (isFunction(value)) {
284 func.prototype[pair[0]] = value;
286 delete func.prototype[pair[0]];
292 'runInContext': function(runInContext) {
293 return function(context) {
294 return baseConvert(util, runInContext(context), options);
299 /*--------------------------------------------------------------------------*/
302 * Creates a clone of `object` by `path`.
305 * @param {Object} object The object to clone.
306 * @param {Array|string} path The path to clone by.
307 * @returns {Object} Returns the cloned object.
309 function cloneByPath(object, path) {
313 length = path.length,
314 lastIndex = length - 1,
315 result = clone(Object(object)),
318 while (nested != null && ++index < length) {
319 var key = path[index],
323 nested[path[index]] = clone(index == lastIndex ? value : Object(value));
325 nested = nested[key];
331 * Converts `lodash` to an immutable auto-curried iteratee-first data-last
332 * version with conversion `options` applied.
334 * @param {Object} [options] The options object. See `baseConvert` for more details.
335 * @returns {Function} Returns the converted `lodash`.
337 function convertLib(options) {
338 return _.runInContext.convert(options)(undefined);
342 * Create a converter function for `func` of `name`.
344 * @param {string} name The name of the function to convert.
345 * @param {Function} func The function to convert.
346 * @returns {Function} Returns the new converter function.
348 function createConverter(name, func) {
349 var oldOptions = options;
350 return function(options) {
351 var newUtil = isLib ? pristine : helpers,
352 newFunc = isLib ? pristine[name] : func,
353 newOptions = assign(assign({}, oldOptions), options);
355 return baseConvert(newUtil, name, newFunc, newOptions);
360 * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
361 * arguments, ignoring any additional arguments.
364 * @param {Function} func The function to cap iteratee arguments for.
365 * @param {number} n The arity cap.
366 * @returns {Function} Returns the new function.
368 function iterateeAry(func, n) {
369 return overArg(func, function(func) {
370 return typeof func == 'function' ? baseAry(func, n) : func;
375 * Creates a function that wraps `func` to invoke its iteratee with arguments
376 * arranged according to the specified `indexes` where the argument value at
377 * the first index is provided as the first argument, the argument value at
378 * the second index is provided as the second argument, and so on.
381 * @param {Function} func The function to rearrange iteratee arguments for.
382 * @param {number[]} indexes The arranged argument indexes.
383 * @returns {Function} Returns the new function.
385 function iterateeRearg(func, indexes) {
386 return overArg(func, function(func) {
387 var n = indexes.length;
388 return baseArity(rearg(baseAry(func, n), indexes), n);
393 * Creates a function that invokes `func` with its first argument passed
397 * @param {Function} func The function to wrap.
398 * @param {...Function} transform The functions to transform the first argument.
399 * @returns {Function} Returns the new function.
401 function overArg(func, transform) {
403 var length = arguments.length;
407 var args = Array(length);
409 args[length] = arguments[length];
411 var index = config.rearg ? 0 : (length - 1);
412 args[index] = transform(args[index]);
413 return func.apply(undefined, args);
418 * Creates a function that wraps `func` and applys the conversions
422 * @param {string} name The name of the function to wrap.
423 * @param {Function} func The function to wrap.
424 * @returns {Function} Returns the converted function.
426 function wrap(name, func) {
427 name = mapping.aliasToReal[name] || name;
431 wrapper = wrappers[name];
434 wrapped = wrapper(func);
436 else if (config.immutable) {
437 if (mutateMap.array[name]) {
438 wrapped = immutWrap(func, cloneArray);
440 else if (mutateMap.object[name]) {
441 wrapped = immutWrap(func, createCloner(func));
443 else if (mutateMap.set[name]) {
444 wrapped = immutWrap(func, cloneByPath);
447 each(aryMethodKeys, function(aryKey) {
448 each(mapping.aryMethod[aryKey], function(otherName) {
449 if (name == otherName) {
450 var aryN = !isLib && mapping.iterateeAry[name],
451 reargIndexes = mapping.iterateeRearg[name],
452 spreadStart = mapping.methodSpread[name];
455 if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
456 result = spreadStart === undefined
457 ? ary(result, aryKey)
458 : spread(result, spreadStart);
460 if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
461 result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
465 result = iterateeRearg(result, reargIndexes);
467 result = iterateeAry(result, aryN);
470 if (forceCurry || (config.curry && aryKey > 1)) {
471 forceCurry && console.log(forceCurry, name);
472 result = curry(result, aryKey);
480 result || (result = wrapped);
481 if (result == func) {
482 result = forceCurry ? curry(result, 1) : function() {
483 return func.apply(this, arguments);
486 result.convert = createConverter(name, func);
487 if (mapping.placeholder[name]) {
488 setPlaceholder = true;
489 result.placeholder = func.placeholder = placeholder;
494 /*--------------------------------------------------------------------------*/
497 return wrap(name, func);
501 // Convert methods by ary cap.
503 each(aryMethodKeys, function(aryKey) {
504 each(mapping.aryMethod[aryKey], function(key) {
505 var func = _[mapping.remap[key] || key];
507 pairs.push([key, wrap(key, func)]);
512 // Convert remaining methods.
513 each(keys(_), function(key) {
515 if (typeof func == 'function') {
516 var length = pairs.length;
518 if (pairs[length][0] == key) {
522 func.convert = createConverter(key, func);
523 pairs.push([key, func]);
527 // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
528 each(pairs, function(pair) {
529 _[pair[0]] = pair[1];
532 _.convert = convertLib;
533 if (setPlaceholder) {
534 _.placeholder = placeholder;
537 each(keys(_), function(key) {
538 each(mapping.realToAlias[key] || [], function(alias) {
546 module.exports = baseConvert;
551 /***/ function(module, exports) {
553 /** Used to map aliases to their real names. */
554 exports.aliasToReal = {
558 'eachRight': 'forEachRight',
559 'entries': 'toPairs',
560 'entriesIn': 'toPairsIn',
561 'extend': 'assignIn',
562 'extendWith': 'assignInWith',
568 'allPass': 'overEvery',
569 'always': 'constant',
571 'anyPass': 'overSome',
575 'complement': 'negate',
576 'compose': 'flowRight',
577 'contains': 'includes',
579 'dissocPath': 'unset',
583 'invertObj': 'invert',
588 'pathEq': 'matchesProperty',
595 'propEq': 'matchesProperty',
600 'useWith': 'overArgs',
602 'zipObj': 'zipObject'
605 /** Used to map ary to method names. */
606 exports.aryMethod = {
608 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
609 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
610 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
611 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
615 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
616 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
617 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
618 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
619 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast',
620 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
621 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
622 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
623 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
624 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
625 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
626 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
627 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
628 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
629 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
630 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
631 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
632 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
633 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
634 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
638 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
639 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
640 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
641 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
642 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
643 'padCharsStart', 'pullAllBy', 'pullAllWith', 'reduce', 'reduceRight', 'replace',
644 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
645 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'
648 'fill', 'setWith', 'updateWith'
652 /** Used to map ary to rearg configs. */
659 /** Used to map method names to their iteratee ary. */
660 exports.iterateeAry = {
673 'findLastIndexFrom': 1,
699 /** Used to map method names to iteratee rearg configs. */
700 exports.iterateeRearg = {
704 /** Used to map method names to rearg configs. */
705 exports.methodRearg = {
706 'assignInWith': [1, 2, 0],
707 'assignWith': [1, 2, 0],
708 'differenceBy': [1, 2, 0],
709 'differenceWith': [1, 2, 0],
711 'intersectionBy': [1, 2, 0],
712 'intersectionWith': [1, 2, 0],
713 'isEqualWith': [1, 2, 0],
714 'isMatchWith': [2, 1, 0],
715 'mergeWith': [1, 2, 0],
716 'padChars': [2, 1, 0],
717 'padCharsEnd': [2, 1, 0],
718 'padCharsStart': [2, 1, 0],
719 'pullAllBy': [2, 1, 0],
720 'pullAllWith': [2, 1, 0],
721 'setWith': [3, 1, 2, 0],
722 'sortedIndexBy': [2, 1, 0],
723 'sortedLastIndexBy': [2, 1, 0],
724 'unionBy': [1, 2, 0],
725 'unionWith': [1, 2, 0],
726 'updateWith': [3, 1, 2, 0],
728 'xorWith': [1, 2, 0],
732 /** Used to map method names to spread configs. */
733 exports.methodSpread = {
741 /** Used to identify methods which mutate arrays or objects. */
756 'assignInWith': true,
759 'defaultsDeep': true,
772 /** Used to track methods with placeholder support */
773 exports.placeholder = {
782 /** Used to map real names to their aliases. */
783 exports.realToAlias = (function() {
784 var hasOwnProperty = Object.prototype.hasOwnProperty,
785 object = exports.aliasToReal,
788 for (var key in object) {
789 var value = object[key];
790 if (hasOwnProperty.call(result, value)) {
791 result[value].push(key);
793 result[value] = [key];
799 /** Used to map method names to other names. */
802 'curryRightN': 'curryRight',
804 'findIndexFrom': 'findIndex',
805 'findLastFrom': 'findLast',
806 'findLastIndexFrom': 'findLastIndex',
808 'includesFrom': 'includes',
809 'indexOfFrom': 'indexOf',
810 'invokeArgs': 'invoke',
811 'invokeArgsMap': 'invokeMap',
812 'lastIndexOfFrom': 'lastIndexOf',
814 'padCharsEnd': 'padEnd',
815 'padCharsStart': 'padStart',
817 'spreadFrom': 'spread',
819 'trimCharsEnd': 'trimEnd',
820 'trimCharsStart': 'trimStart'
823 /** Used to track methods that skip fixing their arity. */
824 exports.skipFixed = {
833 /** Used to track methods that skip rearranging arguments. */
834 exports.skipRearg = {
849 'matchesProperty': true,
854 'partialRight': true,
866 /***/ function(module, exports) {
869 * The default argument placeholder value for methods.