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 version.
62 * @param {Function} lodash The lodash function.
63 * @param {Object} [options] The options object. See `baseConvert` for more details.
64 * @returns {Function} Returns the converted `lodash`.
66 function browserConvert(lodash, options) {
67 return baseConvert(lodash, lodash, options);
70 if (typeof _ == 'function') {
71 _ = browserConvert(_.runInContext());
73 module.exports = browserConvert;
78 /***/ function(module, exports, __webpack_require__) {
80 var mapping = __webpack_require__(2),
81 mutateMap = mapping.mutate,
85 * The base implementation of `convert` which accepts a `util` object of methods
86 * required to perform conversions.
88 * @param {Object} util The util object.
89 * @param {string} name The name of the function to wrap.
90 * @param {Function} func The function to wrap.
91 * @param {Object} [options] The options object.
92 * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
93 * @param {boolean} [options.curry=true] Specify currying.
94 * @param {boolean} [options.fixed=true] Specify fixed arity.
95 * @param {boolean} [options.immutable=true] Specify immutable operations.
96 * @param {boolean} [options.rearg=true] Specify rearranging arguments.
97 * @returns {Function|Object} Returns the converted function or object.
99 function baseConvert(util, name, func, options) {
101 isLib = typeof name == 'function',
102 isObj = name === Object(name);
112 options || (options = {});
115 'cap': 'cap' in options ? options.cap : true,
116 'curry': 'curry' in options ? options.curry : true,
117 'fixed': 'fixed' in options ? options.fixed : true,
118 'immutable': 'immutable' in options ? options.immutable : true,
119 'rearg': 'rearg' in options ? options.rearg : true
122 var forceRearg = ('rearg' in options) && options.rearg;
124 var helpers = isLib ? func : {
128 'forEach': util.forEach,
129 'isArray': util.isArray,
130 'isFunction': util.isFunction,
131 'iteratee': util.iteratee,
134 'spread': util.spread,
135 'toPath': util.toPath
138 var ary = helpers.ary,
139 clone = helpers.clone,
140 curry = helpers.curry,
141 each = helpers.forEach,
142 isArray = helpers.isArray,
143 isFunction = helpers.isFunction,
145 rearg = helpers.rearg,
146 spread = helpers.spread,
147 toPath = helpers.toPath;
149 var aryMethodKeys = keys(mapping.aryMethod);
151 var baseArity = function(func, n) {
153 ? function(a, b) { return func.apply(undefined, arguments); }
154 : function(a) { return func.apply(undefined, arguments); };
157 var baseAry = function(func, n) {
159 ? function(a, b) { return func(a, b); }
160 : function(a) { return func(a); };
163 var cloneArray = function(array) {
164 var length = array ? array.length : 0,
165 result = Array(length);
168 result[length] = array[length];
173 var cloneByPath = function(object, path) {
177 length = path.length,
178 result = clone(Object(object)),
181 while (nested != null && ++index < length) {
182 var key = path[index],
186 nested[key] = clone(Object(value));
188 nested = nested[key];
193 var createCloner = function(func) {
194 return function(object) {
195 return func({}, object);
199 var immutWrap = function(func, cloner) {
201 var length = arguments.length;
205 var args = Array(length);
207 args[length] = arguments[length];
209 var result = args[0] = cloner.apply(undefined, args);
210 func.apply(undefined, args);
215 var iterateeAry = function(func, n) {
216 return overArg(func, function(func) {
217 return typeof func == 'function' ? baseAry(func, n) : func;
221 var iterateeRearg = function(func, indexes) {
222 return overArg(func, function(func) {
223 var n = indexes.length;
224 return baseArity(rearg(baseAry(func, n), indexes), n);
228 var overArg = function(func, iteratee, retArg) {
230 var length = arguments.length;
234 var args = Array(length);
236 args[length] = arguments[length];
238 var index = config.rearg ? 0 : (length - 1);
239 args[index] = iteratee(args[index]);
240 return func.apply(undefined, args);
245 'castArray': function(castArray) {
247 var value = arguments[0];
248 return isArray(value)
249 ? castArray(cloneArray(value))
250 : castArray.apply(undefined, arguments);
253 'iteratee': function(iteratee) {
255 var func = arguments[0],
256 arity = arguments[1],
257 result = iteratee(func, arity),
258 length = result.length;
260 if (config.cap && typeof arity == 'number') {
261 arity = arity > 2 ? (arity - 2) : 1;
262 return (length && length <= arity) ? result : baseAry(result, arity);
267 'mixin': function(mixin) {
268 return function(source) {
270 if (!isFunction(func)) {
271 return mixin(func, Object(source));
276 each(keys(source), function(key) {
277 var value = source[key];
278 if (isFunction(value)) {
279 methodNames.push(key);
280 methods.push(func.prototype[key]);
284 mixin(func, Object(source));
286 each(methodNames, function(methodName, index) {
287 var method = methods[index];
288 if (isFunction(method)) {
289 func.prototype[methodName] = method;
291 delete func.prototype[methodName];
297 'runInContext': function(runInContext) {
298 return function(context) {
299 return baseConvert(util, runInContext(context), options);
304 var wrap = function(name, func) {
305 name = mapping.aliasToReal[name] || name;
306 var wrapper = wrappers[name];
308 return wrapper(func);
311 if (config.immutable) {
312 if (mutateMap.array[name]) {
313 wrapped = immutWrap(func, cloneArray);
315 else if (mutateMap.object[name]) {
316 wrapped = immutWrap(func, createCloner(func));
318 else if (mutateMap.set[name]) {
319 wrapped = immutWrap(func, cloneByPath);
323 each(aryMethodKeys, function(aryKey) {
324 each(mapping.aryMethod[aryKey], function(otherName) {
325 if (name == otherName) {
326 var aryN = !isLib && mapping.iterateeAry[name],
327 reargIndexes = mapping.iterateeRearg[name],
328 spreadStart = mapping.methodSpread[name];
332 result = spreadStart === undefined
333 ? ary(result, aryKey)
334 : spread(result, spreadStart);
336 if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
337 result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
341 result = iterateeRearg(result, reargIndexes);
343 result = iterateeAry(result, aryN);
346 if (config.curry && aryKey > 1) {
347 result = curry(result, aryKey);
355 result || (result = wrapped);
356 if (mapping.placeholder[name]) {
357 setPlaceholder = true;
358 func.placeholder = result.placeholder = placeholder;
364 return wrap(name, func);
368 // Iterate over methods for the current ary cap.
370 each(aryMethodKeys, function(aryKey) {
371 each(mapping.aryMethod[aryKey], function(key) {
372 var func = _[mapping.remap[key] || key];
374 pairs.push([key, wrap(key, func)]);
379 // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
380 each(pairs, function(pair) {
381 _[pair[0]] = pair[1];
384 if (setPlaceholder) {
385 _.placeholder = placeholder;
387 // Wrap the lodash method and its aliases.
388 each(keys(_), function(key) {
389 each(mapping.realToAlias[key] || [], function(alias) {
397 module.exports = baseConvert;
402 /***/ function(module, exports) {
404 /** Used to map aliases to their real names. */
405 exports.aliasToReal = {
408 'allPass': 'overEvery',
412 'compose': 'flowRight',
413 'contains': 'includes',
415 'dissocPath': 'unset',
417 'eachRight': 'forEachRight',
419 'extend': 'assignIn',
420 'extendWith': 'assignInWith',
423 'mapObj': 'mapValues',
427 'pathEq': 'matchesProperty',
432 'propOf': 'propertyOf',
434 'somePass': 'overSome',
437 'useWith': 'overArgs',
439 'zipObj': 'zipObject'
442 /** Used to map ary to method names. */
443 exports.aryMethod = {
445 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
446 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'methodOf', 'mixin',
447 'over', 'overEvery', 'overSome', 'rest', 'reverse', 'round', 'runInContext',
448 'spread', 'template', 'trim', 'trimEnd', 'trimStart', 'uniqueId', 'words'
451 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindKey',
452 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
453 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
454 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq', 'every',
455 'filter', 'find', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
456 'findLastKey', 'flatMap', 'flattenDepth', 'forEach', 'forEachRight', 'forIn',
457 'forInRight', 'forOwn', 'forOwnRight', 'get', 'groupBy', 'gt', 'gte', 'has',
458 'hasIn', 'includes', 'indexOf', 'intersection', 'invertBy', 'invoke', 'invokeMap',
459 'isEqual', 'isMatch', 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map',
460 'mapKeys', 'mapValues', 'matchesProperty', 'maxBy', 'merge', 'minBy', 'omit',
461 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
462 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
463 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
464 'repeat', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
465 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
466 'split', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight', 'takeRightWhile',
467 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars', 'trimCharsEnd',
468 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith', 'unset',
469 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject', 'zipObjectDeep'
472 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
473 'getOr', 'inRange', 'intersectionBy', 'intersectionWith', 'isEqualWith',
474 'isMatchWith', 'mergeWith', 'orderBy', 'pullAllBy', 'reduce', 'reduceRight',
475 'replace', 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform',
476 'unionBy', 'unionWith', 'xorBy', 'xorWith', 'zipWith'
483 /** Used to map ary to rearg configs. */
490 /** Used to map method names to their iteratee ary. */
491 exports.iterateeAry = {
530 /** Used to map method names to iteratee rearg configs. */
531 exports.iterateeRearg = {
535 /** Used to map method names to rearg configs. */
536 exports.methodRearg = {
537 'assignInWith': [1, 2, 0],
538 'assignWith': [1, 2, 0],
540 'isMatchWith': [2, 1, 0],
541 'mergeWith': [1, 2, 0],
542 'pullAllBy': [2, 1, 0],
543 'setWith': [3, 1, 2, 0],
544 'sortedIndexBy': [2, 1, 0],
545 'sortedLastIndexBy': [2, 1, 0],
549 /** Used to map method names to spread configs. */
550 exports.methodSpread = {
555 /** Used to identify methods which mutate arrays or objects. */
569 'assignInWith': true,
572 'defaultsDeep': true,
583 /** Used to track methods with placeholder support */
584 exports.placeholder = {
593 /** Used to map real names to their aliases. */
594 exports.realToAlias = (function() {
595 var hasOwnProperty = Object.prototype.hasOwnProperty,
596 object = exports.aliasToReal,
599 for (var key in object) {
600 var value = object[key];
601 if (hasOwnProperty.call(result, value)) {
602 result[value].push(key);
604 result[value] = [key];
610 /** Used to map method names to other names. */
613 'curryRightN': 'curryRight',
616 'trimCharsEnd': 'trimEnd',
617 'trimCharsStart': 'trimStart'
620 /** Used to track methods that skip `_.rearg`. */
621 exports.skipRearg = {
631 'matchesProperty': true,
634 'partialRight': true,