lodash.fp.js 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001
  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. /******/ // The require function
  15. /******/ function __webpack_require__(moduleId) {
  16. /******/ // Check if module is in cache
  17. /******/ if(installedModules[moduleId])
  18. /******/ return installedModules[moduleId].exports;
  19. /******/ // Create a new module (and put it into the cache)
  20. /******/ var module = installedModules[moduleId] = {
  21. /******/ exports: {},
  22. /******/ id: moduleId,
  23. /******/ loaded: false
  24. /******/ };
  25. /******/ // Execute the module function
  26. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  27. /******/ // Flag the module as loaded
  28. /******/ module.loaded = true;
  29. /******/ // Return the exports of the module
  30. /******/ return module.exports;
  31. /******/ }
  32. /******/ // expose the modules object (__webpack_modules__)
  33. /******/ __webpack_require__.m = modules;
  34. /******/ // expose the module cache
  35. /******/ __webpack_require__.c = installedModules;
  36. /******/ // __webpack_public_path__
  37. /******/ __webpack_require__.p = "";
  38. /******/ // Load entry module and return exports
  39. /******/ return __webpack_require__(0);
  40. /******/ })
  41. /************************************************************************/
  42. /******/ ([
  43. /* 0 */
  44. /***/ function(module, exports, __webpack_require__) {
  45. var baseConvert = __webpack_require__(1);
  46. /**
  47. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  48. * version with conversion `options` applied.
  49. *
  50. * @param {Function} lodash The lodash function to convert.
  51. * @param {Object} [options] The options object. See `baseConvert` for more details.
  52. * @returns {Function} Returns the converted `lodash`.
  53. */
  54. function browserConvert(lodash, options) {
  55. return baseConvert(lodash, lodash, options);
  56. }
  57. if (typeof _ == 'function') {
  58. _ = browserConvert(_.runInContext());
  59. }
  60. module.exports = browserConvert;
  61. /***/ },
  62. /* 1 */
  63. /***/ function(module, exports, __webpack_require__) {
  64. var mapping = __webpack_require__(2),
  65. mutateMap = mapping.mutate,
  66. fallbackHolder = __webpack_require__(3);
  67. /**
  68. * Creates a function, with an arity of `n`, that invokes `func` with the
  69. * arguments it receives.
  70. *
  71. * @private
  72. * @param {Function} func The function to wrap.
  73. * @param {number} n The arity of the new function.
  74. * @returns {Function} Returns the new function.
  75. */
  76. function baseArity(func, n) {
  77. return n == 2
  78. ? function(a, b) { return func.apply(undefined, arguments); }
  79. : function(a) { return func.apply(undefined, arguments); };
  80. }
  81. /**
  82. * Creates a function that invokes `func`, with up to `n` arguments, ignoring
  83. * any additional arguments.
  84. *
  85. * @private
  86. * @param {Function} func The function to cap arguments for.
  87. * @param {number} n The arity cap.
  88. * @returns {Function} Returns the new function.
  89. */
  90. function baseAry(func, n) {
  91. return n == 2
  92. ? function(a, b) { return func(a, b); }
  93. : function(a) { return func(a); };
  94. }
  95. /**
  96. * Creates a clone of `array`.
  97. *
  98. * @private
  99. * @param {Array} array The array to clone.
  100. * @returns {Array} Returns the cloned array.
  101. */
  102. function cloneArray(array) {
  103. var length = array ? array.length : 0,
  104. result = Array(length);
  105. while (length--) {
  106. result[length] = array[length];
  107. }
  108. return result;
  109. }
  110. /**
  111. * Creates a function that clones a given object using the assignment `func`.
  112. *
  113. * @private
  114. * @param {Function} func The assignment function.
  115. * @returns {Function} Returns the new cloner function.
  116. */
  117. function createCloner(func) {
  118. return function(object) {
  119. return func({}, object);
  120. };
  121. }
  122. /**
  123. * Creates a function that wraps `func` and uses `cloner` to clone the first
  124. * argument it receives.
  125. *
  126. * @private
  127. * @param {Function} func The function to wrap.
  128. * @param {Function} cloner The function to clone arguments.
  129. * @returns {Function} Returns the new immutable function.
  130. */
  131. function wrapImmutable(func, cloner) {
  132. return function() {
  133. var length = arguments.length;
  134. if (!length) {
  135. return;
  136. }
  137. var args = Array(length);
  138. while (length--) {
  139. args[length] = arguments[length];
  140. }
  141. var result = args[0] = cloner.apply(undefined, args);
  142. func.apply(undefined, args);
  143. return result;
  144. };
  145. }
  146. /**
  147. * The base implementation of `convert` which accepts a `util` object of methods
  148. * required to perform conversions.
  149. *
  150. * @param {Object} util The util object.
  151. * @param {string} name The name of the function to convert.
  152. * @param {Function} func The function to convert.
  153. * @param {Object} [options] The options object.
  154. * @param {boolean} [options.cap=true] Specify capping iteratee arguments.
  155. * @param {boolean} [options.curry=true] Specify currying.
  156. * @param {boolean} [options.fixed=true] Specify fixed arity.
  157. * @param {boolean} [options.immutable=true] Specify immutable operations.
  158. * @param {boolean} [options.rearg=true] Specify rearranging arguments.
  159. * @returns {Function|Object} Returns the converted function or object.
  160. */
  161. function baseConvert(util, name, func, options) {
  162. var setPlaceholder,
  163. isLib = typeof name == 'function',
  164. isObj = name === Object(name);
  165. if (isObj) {
  166. options = func;
  167. func = name;
  168. name = undefined;
  169. }
  170. if (func == null) {
  171. throw new TypeError;
  172. }
  173. options || (options = {});
  174. var config = {
  175. 'cap': 'cap' in options ? options.cap : true,
  176. 'curry': 'curry' in options ? options.curry : true,
  177. 'fixed': 'fixed' in options ? options.fixed : true,
  178. 'immutable': 'immutable' in options ? options.immutable : true,
  179. 'rearg': 'rearg' in options ? options.rearg : true
  180. };
  181. var forceCurry = ('curry' in options) && options.curry,
  182. forceFixed = ('fixed' in options) && options.fixed,
  183. forceRearg = ('rearg' in options) && options.rearg,
  184. placeholder = isLib ? func : fallbackHolder,
  185. pristine = isLib ? func.runInContext() : undefined;
  186. var helpers = isLib ? func : {
  187. 'ary': util.ary,
  188. 'assign': util.assign,
  189. 'clone': util.clone,
  190. 'curry': util.curry,
  191. 'forEach': util.forEach,
  192. 'isArray': util.isArray,
  193. 'isFunction': util.isFunction,
  194. 'iteratee': util.iteratee,
  195. 'keys': util.keys,
  196. 'rearg': util.rearg,
  197. 'spread': util.spread,
  198. 'toInteger': util.toInteger,
  199. 'toPath': util.toPath
  200. };
  201. var ary = helpers.ary,
  202. assign = helpers.assign,
  203. clone = helpers.clone,
  204. curry = helpers.curry,
  205. each = helpers.forEach,
  206. isArray = helpers.isArray,
  207. isFunction = helpers.isFunction,
  208. keys = helpers.keys,
  209. rearg = helpers.rearg,
  210. spread = helpers.spread,
  211. toInteger = helpers.toInteger,
  212. toPath = helpers.toPath;
  213. var aryMethodKeys = keys(mapping.aryMethod);
  214. var wrappers = {
  215. 'castArray': function(castArray) {
  216. return function() {
  217. var value = arguments[0];
  218. return isArray(value)
  219. ? castArray(cloneArray(value))
  220. : castArray.apply(undefined, arguments);
  221. };
  222. },
  223. 'iteratee': function(iteratee) {
  224. return function() {
  225. var func = arguments[0],
  226. arity = arguments[1],
  227. result = iteratee(func, arity),
  228. length = result.length;
  229. if (config.cap && typeof arity == 'number') {
  230. arity = arity > 2 ? (arity - 2) : 1;
  231. return (length && length <= arity) ? result : baseAry(result, arity);
  232. }
  233. return result;
  234. };
  235. },
  236. 'mixin': function(mixin) {
  237. return function(source) {
  238. var func = this;
  239. if (!isFunction(func)) {
  240. return mixin(func, Object(source));
  241. }
  242. var pairs = [];
  243. each(keys(source), function(key) {
  244. if (isFunction(source[key])) {
  245. pairs.push([key, func.prototype[key]]);
  246. }
  247. });
  248. mixin(func, Object(source));
  249. each(pairs, function(pair) {
  250. var value = pair[1];
  251. if (isFunction(value)) {
  252. func.prototype[pair[0]] = value;
  253. } else {
  254. delete func.prototype[pair[0]];
  255. }
  256. });
  257. return func;
  258. };
  259. },
  260. 'nthArg': function(nthArg) {
  261. return function(n) {
  262. var arity = n < 0 ? 1 : (toInteger(n) + 1);
  263. return curry(nthArg(n), arity);
  264. };
  265. },
  266. 'rearg': function(rearg) {
  267. return function(func, indexes) {
  268. var arity = indexes ? indexes.length : 0;
  269. return curry(rearg(func, indexes), arity);
  270. };
  271. },
  272. 'runInContext': function(runInContext) {
  273. return function(context) {
  274. return baseConvert(util, runInContext(context), options);
  275. };
  276. }
  277. };
  278. /*--------------------------------------------------------------------------*/
  279. /**
  280. * Casts `func` to a function with an arity capped iteratee if needed.
  281. *
  282. * @private
  283. * @param {string} name The name of the function to inspect.
  284. * @param {Function} func The function to inspect.
  285. * @returns {Function} Returns the cast function.
  286. */
  287. function castCap(name, func) {
  288. if (config.cap) {
  289. var indexes = mapping.iterateeRearg[name];
  290. if (indexes) {
  291. return iterateeRearg(func, indexes);
  292. }
  293. var n = !isLib && mapping.iterateeAry[name];
  294. if (n) {
  295. return iterateeAry(func, n);
  296. }
  297. }
  298. return func;
  299. }
  300. /**
  301. * Casts `func` to a curried function if needed.
  302. *
  303. * @private
  304. * @param {string} name The name of the function to inspect.
  305. * @param {Function} func The function to inspect.
  306. * @param {number} n The arity of `func`.
  307. * @returns {Function} Returns the cast function.
  308. */
  309. function castCurry(name, func, n) {
  310. return (forceCurry || (config.curry && n > 1))
  311. ? curry(func, n)
  312. : func;
  313. }
  314. /**
  315. * Casts `func` to a fixed arity function if needed.
  316. *
  317. * @private
  318. * @param {string} name The name of the function to inspect.
  319. * @param {Function} func The function to inspect.
  320. * @param {number} n The arity cap.
  321. * @returns {Function} Returns the cast function.
  322. */
  323. function castFixed(name, func, n) {
  324. if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
  325. var data = mapping.methodSpread[name],
  326. start = data && data.start;
  327. return start === undefined ? ary(func, n) : spread(func, start);
  328. }
  329. return func;
  330. }
  331. /**
  332. * Casts `func` to an rearged function if needed.
  333. *
  334. * @private
  335. * @param {string} name The name of the function to inspect.
  336. * @param {Function} func The function to inspect.
  337. * @param {number} n The arity of `func`.
  338. * @returns {Function} Returns the cast function.
  339. */
  340. function castRearg(name, func, n) {
  341. return (config.rearg && n > 1 && (forceRearg || !mapping.skipRearg[name]))
  342. ? rearg(func, mapping.methodRearg[name] || mapping.aryRearg[n])
  343. : func;
  344. }
  345. /**
  346. * Creates a clone of `object` by `path`.
  347. *
  348. * @private
  349. * @param {Object} object The object to clone.
  350. * @param {Array|string} path The path to clone by.
  351. * @returns {Object} Returns the cloned object.
  352. */
  353. function cloneByPath(object, path) {
  354. path = toPath(path);
  355. var index = -1,
  356. length = path.length,
  357. lastIndex = length - 1,
  358. result = clone(Object(object)),
  359. nested = result;
  360. while (nested != null && ++index < length) {
  361. var key = path[index],
  362. value = nested[key];
  363. if (value != null) {
  364. nested[path[index]] = clone(index == lastIndex ? value : Object(value));
  365. }
  366. nested = nested[key];
  367. }
  368. return result;
  369. }
  370. /**
  371. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  372. * version with conversion `options` applied.
  373. *
  374. * @param {Object} [options] The options object. See `baseConvert` for more details.
  375. * @returns {Function} Returns the converted `lodash`.
  376. */
  377. function convertLib(options) {
  378. return _.runInContext.convert(options)(undefined);
  379. }
  380. /**
  381. * Create a converter function for `func` of `name`.
  382. *
  383. * @param {string} name The name of the function to convert.
  384. * @param {Function} func The function to convert.
  385. * @returns {Function} Returns the new converter function.
  386. */
  387. function createConverter(name, func) {
  388. var oldOptions = options;
  389. return function(options) {
  390. var newUtil = isLib ? pristine : helpers,
  391. newFunc = isLib ? pristine[name] : func,
  392. newOptions = assign(assign({}, oldOptions), options);
  393. return baseConvert(newUtil, name, newFunc, newOptions);
  394. };
  395. }
  396. /**
  397. * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
  398. * arguments, ignoring any additional arguments.
  399. *
  400. * @private
  401. * @param {Function} func The function to cap iteratee arguments for.
  402. * @param {number} n The arity cap.
  403. * @returns {Function} Returns the new function.
  404. */
  405. function iterateeAry(func, n) {
  406. return overArg(func, function(func) {
  407. return typeof func == 'function' ? baseAry(func, n) : func;
  408. });
  409. }
  410. /**
  411. * Creates a function that wraps `func` to invoke its iteratee with arguments
  412. * arranged according to the specified `indexes` where the argument value at
  413. * the first index is provided as the first argument, the argument value at
  414. * the second index is provided as the second argument, and so on.
  415. *
  416. * @private
  417. * @param {Function} func The function to rearrange iteratee arguments for.
  418. * @param {number[]} indexes The arranged argument indexes.
  419. * @returns {Function} Returns the new function.
  420. */
  421. function iterateeRearg(func, indexes) {
  422. return overArg(func, function(func) {
  423. var n = indexes.length;
  424. return baseArity(rearg(baseAry(func, n), indexes), n);
  425. });
  426. }
  427. /**
  428. * Creates a function that invokes `func` with its first argument transformed.
  429. *
  430. * @private
  431. * @param {Function} func The function to wrap.
  432. * @param {Function} transform The argument transform.
  433. * @returns {Function} Returns the new function.
  434. */
  435. function overArg(func, transform) {
  436. return function() {
  437. var length = arguments.length;
  438. if (!length) {
  439. return func();
  440. }
  441. var args = Array(length);
  442. while (length--) {
  443. args[length] = arguments[length];
  444. }
  445. var index = config.rearg ? 0 : (length - 1);
  446. args[index] = transform(args[index]);
  447. return func.apply(undefined, args);
  448. };
  449. }
  450. /**
  451. * Creates a function that wraps `func` and applys the conversions
  452. * rules by `name`.
  453. *
  454. * @private
  455. * @param {string} name The name of the function to wrap.
  456. * @param {Function} func The function to wrap.
  457. * @returns {Function} Returns the converted function.
  458. */
  459. function wrap(name, func) {
  460. name = mapping.aliasToReal[name] || name;
  461. var result,
  462. wrapped = func,
  463. wrapper = wrappers[name];
  464. if (wrapper) {
  465. wrapped = wrapper(func);
  466. }
  467. else if (config.immutable) {
  468. if (mutateMap.array[name]) {
  469. wrapped = wrapImmutable(func, cloneArray);
  470. }
  471. else if (mutateMap.object[name]) {
  472. wrapped = wrapImmutable(func, createCloner(func));
  473. }
  474. else if (mutateMap.set[name]) {
  475. wrapped = wrapImmutable(func, cloneByPath);
  476. }
  477. }
  478. each(aryMethodKeys, function(aryKey) {
  479. each(mapping.aryMethod[aryKey], function(otherName) {
  480. if (name == otherName) {
  481. var spreadData = mapping.methodSpread[name],
  482. afterRearg = spreadData && spreadData.afterRearg;
  483. result = afterRearg
  484. ? castFixed(name, castRearg(name, wrapped, aryKey), aryKey)
  485. : castRearg(name, castFixed(name, wrapped, aryKey), aryKey);
  486. result = castCap(name, result);
  487. result = castCurry(name, result, aryKey);
  488. return false;
  489. }
  490. });
  491. return !result;
  492. });
  493. result || (result = wrapped);
  494. if (result == func) {
  495. result = forceCurry ? curry(result, 1) : function() {
  496. return func.apply(this, arguments);
  497. };
  498. }
  499. result.convert = createConverter(name, func);
  500. if (mapping.placeholder[name]) {
  501. setPlaceholder = true;
  502. result.placeholder = func.placeholder = placeholder;
  503. }
  504. return result;
  505. }
  506. /*--------------------------------------------------------------------------*/
  507. if (!isObj) {
  508. return wrap(name, func);
  509. }
  510. var _ = func;
  511. // Convert methods by ary cap.
  512. var pairs = [];
  513. each(aryMethodKeys, function(aryKey) {
  514. each(mapping.aryMethod[aryKey], function(key) {
  515. var func = _[mapping.remap[key] || key];
  516. if (func) {
  517. pairs.push([key, wrap(key, func)]);
  518. }
  519. });
  520. });
  521. // Convert remaining methods.
  522. each(keys(_), function(key) {
  523. var func = _[key];
  524. if (typeof func == 'function') {
  525. var length = pairs.length;
  526. while (length--) {
  527. if (pairs[length][0] == key) {
  528. return;
  529. }
  530. }
  531. func.convert = createConverter(key, func);
  532. pairs.push([key, func]);
  533. }
  534. });
  535. // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
  536. each(pairs, function(pair) {
  537. _[pair[0]] = pair[1];
  538. });
  539. _.convert = convertLib;
  540. if (setPlaceholder) {
  541. _.placeholder = placeholder;
  542. }
  543. // Assign aliases.
  544. each(keys(_), function(key) {
  545. each(mapping.realToAlias[key] || [], function(alias) {
  546. _[alias] = _[key];
  547. });
  548. });
  549. return _;
  550. }
  551. module.exports = baseConvert;
  552. /***/ },
  553. /* 2 */
  554. /***/ function(module, exports) {
  555. /** Used to map aliases to their real names. */
  556. exports.aliasToReal = {
  557. // Lodash aliases.
  558. 'each': 'forEach',
  559. 'eachRight': 'forEachRight',
  560. 'entries': 'toPairs',
  561. 'entriesIn': 'toPairsIn',
  562. 'extend': 'assignIn',
  563. 'extendAll': 'assignInAll',
  564. 'extendAllWith': 'assignInAllWith',
  565. 'extendWith': 'assignInWith',
  566. 'first': 'head',
  567. // Methods that are curried variants of others.
  568. 'conforms': 'conformsTo',
  569. 'matches': 'isMatch',
  570. 'property': 'get',
  571. // Ramda aliases.
  572. '__': 'placeholder',
  573. 'F': 'stubFalse',
  574. 'T': 'stubTrue',
  575. 'all': 'every',
  576. 'allPass': 'overEvery',
  577. 'always': 'constant',
  578. 'any': 'some',
  579. 'anyPass': 'overSome',
  580. 'apply': 'spread',
  581. 'assoc': 'set',
  582. 'assocPath': 'set',
  583. 'complement': 'negate',
  584. 'compose': 'flowRight',
  585. 'contains': 'includes',
  586. 'dissoc': 'unset',
  587. 'dissocPath': 'unset',
  588. 'dropLast': 'dropRight',
  589. 'dropLastWhile': 'dropRightWhile',
  590. 'equals': 'isEqual',
  591. 'identical': 'eq',
  592. 'indexBy': 'keyBy',
  593. 'init': 'initial',
  594. 'invertObj': 'invert',
  595. 'juxt': 'over',
  596. 'omitAll': 'omit',
  597. 'nAry': 'ary',
  598. 'path': 'get',
  599. 'pathEq': 'matchesProperty',
  600. 'pathOr': 'getOr',
  601. 'paths': 'at',
  602. 'pickAll': 'pick',
  603. 'pipe': 'flow',
  604. 'pluck': 'map',
  605. 'prop': 'get',
  606. 'propEq': 'matchesProperty',
  607. 'propOr': 'getOr',
  608. 'props': 'at',
  609. 'symmetricDifference': 'xor',
  610. 'symmetricDifferenceBy': 'xorBy',
  611. 'symmetricDifferenceWith': 'xorWith',
  612. 'takeLast': 'takeRight',
  613. 'takeLastWhile': 'takeRightWhile',
  614. 'unapply': 'rest',
  615. 'unnest': 'flatten',
  616. 'useWith': 'overArgs',
  617. 'where': 'conformsTo',
  618. 'whereEq': 'isMatch',
  619. 'zipObj': 'zipObject'
  620. };
  621. /** Used to map ary to method names. */
  622. exports.aryMethod = {
  623. '1': [
  624. 'assignAll', 'assignInAll', 'attempt', 'castArray', 'ceil', 'create',
  625. 'curry', 'curryRight', 'defaultsAll', 'defaultsDeepAll', 'floor', 'flow',
  626. 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method', 'mergeAll',
  627. 'methodOf', 'mixin', 'nthArg', 'over', 'overEvery', 'overSome','rest', 'reverse',
  628. 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
  629. 'uniqueId', 'words', 'zipAll'
  630. ],
  631. '2': [
  632. 'add', 'after', 'ary', 'assign', 'assignAllWith', 'assignIn', 'assignInAllWith',
  633. 'at', 'before', 'bind', 'bindAll', 'bindKey', 'chunk', 'cloneDeepWith',
  634. 'cloneWith', 'concat', 'conformsTo', 'countBy', 'curryN', 'curryRightN',
  635. 'debounce', 'defaults', 'defaultsDeep', 'defaultTo', 'delay', 'difference',
  636. 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith', 'eq',
  637. 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast', 'findLastIndex',
  638. 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth', 'forEach',
  639. 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight', 'get',
  640. 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf', 'intersection',
  641. 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch', 'join', 'keyBy',
  642. 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues', 'matchesProperty',
  643. 'maxBy', 'meanBy', 'merge', 'mergeAllWith', 'minBy', 'multiply', 'nth', 'omit',
  644. 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt', 'partial',
  645. 'partialRight', 'partition', 'pick', 'pickBy', 'propertyOf', 'pull', 'pullAll',
  646. 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
  647. 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
  648. 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
  649. 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
  650. 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
  651. 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
  652. 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
  653. 'zipObjectDeep'
  654. ],
  655. '3': [
  656. 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
  657. 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
  658. 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
  659. 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
  660. 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
  661. 'padCharsStart', 'pullAllBy', 'pullAllWith', 'reduce', 'reduceRight', 'replace',
  662. 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
  663. 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'
  664. ],
  665. '4': [
  666. 'fill', 'setWith', 'updateWith'
  667. ]
  668. };
  669. /** Used to map ary to rearg configs. */
  670. exports.aryRearg = {
  671. '2': [1, 0],
  672. '3': [2, 0, 1],
  673. '4': [3, 2, 0, 1]
  674. };
  675. /** Used to map method names to their iteratee ary. */
  676. exports.iterateeAry = {
  677. 'dropRightWhile': 1,
  678. 'dropWhile': 1,
  679. 'every': 1,
  680. 'filter': 1,
  681. 'find': 1,
  682. 'findFrom': 1,
  683. 'findIndex': 1,
  684. 'findIndexFrom': 1,
  685. 'findKey': 1,
  686. 'findLast': 1,
  687. 'findLastFrom': 1,
  688. 'findLastIndex': 1,
  689. 'findLastIndexFrom': 1,
  690. 'findLastKey': 1,
  691. 'flatMap': 1,
  692. 'flatMapDeep': 1,
  693. 'flatMapDepth': 1,
  694. 'forEach': 1,
  695. 'forEachRight': 1,
  696. 'forIn': 1,
  697. 'forInRight': 1,
  698. 'forOwn': 1,
  699. 'forOwnRight': 1,
  700. 'map': 1,
  701. 'mapKeys': 1,
  702. 'mapValues': 1,
  703. 'partition': 1,
  704. 'reduce': 2,
  705. 'reduceRight': 2,
  706. 'reject': 1,
  707. 'remove': 1,
  708. 'some': 1,
  709. 'takeRightWhile': 1,
  710. 'takeWhile': 1,
  711. 'times': 1,
  712. 'transform': 2
  713. };
  714. /** Used to map method names to iteratee rearg configs. */
  715. exports.iterateeRearg = {
  716. 'mapKeys': [1]
  717. };
  718. /** Used to map method names to rearg configs. */
  719. exports.methodRearg = {
  720. 'assignInAllWith': [1, 2, 0],
  721. 'assignInWith': [1, 2, 0],
  722. 'assignAllWith': [1, 2, 0],
  723. 'assignWith': [1, 2, 0],
  724. 'differenceBy': [1, 2, 0],
  725. 'differenceWith': [1, 2, 0],
  726. 'getOr': [2, 1, 0],
  727. 'intersectionBy': [1, 2, 0],
  728. 'intersectionWith': [1, 2, 0],
  729. 'isEqualWith': [1, 2, 0],
  730. 'isMatchWith': [2, 1, 0],
  731. 'mergeAllWith': [1, 2, 0],
  732. 'mergeWith': [1, 2, 0],
  733. 'padChars': [2, 1, 0],
  734. 'padCharsEnd': [2, 1, 0],
  735. 'padCharsStart': [2, 1, 0],
  736. 'pullAllBy': [2, 1, 0],
  737. 'pullAllWith': [2, 1, 0],
  738. 'setWith': [3, 1, 2, 0],
  739. 'sortedIndexBy': [2, 1, 0],
  740. 'sortedLastIndexBy': [2, 1, 0],
  741. 'unionBy': [1, 2, 0],
  742. 'unionWith': [1, 2, 0],
  743. 'updateWith': [3, 1, 2, 0],
  744. 'xorBy': [1, 2, 0],
  745. 'xorWith': [1, 2, 0],
  746. 'zipWith': [1, 2, 0]
  747. };
  748. /** Used to map method names to spread configs. */
  749. exports.methodSpread = {
  750. 'assignAll': { 'start': 0 },
  751. 'assignAllWith': { 'afterRearg': true, 'start': 1 },
  752. 'assignInAll': { 'start': 0 },
  753. 'assignInAllWith': { 'afterRearg': true, 'start': 1 },
  754. 'defaultsAll': { 'start': 0 },
  755. 'defaultsDeepAll': { 'start': 0 },
  756. 'invokeArgs': { 'start': 2 },
  757. 'invokeArgsMap': { 'start': 2 },
  758. 'mergeAll': { 'start': 0 },
  759. 'mergeAllWith': { 'afterRearg': true, 'start': 1 },
  760. 'partial': { 'start': 1 },
  761. 'partialRight': { 'start': 1 },
  762. 'without': { 'start': 1 },
  763. 'zipAll': { 'start': 0 }
  764. };
  765. /** Used to identify methods which mutate arrays or objects. */
  766. exports.mutate = {
  767. 'array': {
  768. 'fill': true,
  769. 'pull': true,
  770. 'pullAll': true,
  771. 'pullAllBy': true,
  772. 'pullAllWith': true,
  773. 'pullAt': true,
  774. 'remove': true,
  775. 'reverse': true
  776. },
  777. 'object': {
  778. 'assign': true,
  779. 'assignAll': true,
  780. 'assignAllWith': true,
  781. 'assignIn': true,
  782. 'assignInAll': true,
  783. 'assignInAllWith': true,
  784. 'assignInWith': true,
  785. 'assignWith': true,
  786. 'defaults': true,
  787. 'defaultsAll': true,
  788. 'defaultsDeep': true,
  789. 'defaultsDeepAll': true,
  790. 'merge': true,
  791. 'mergeAll': true,
  792. 'mergeAllWith': true,
  793. 'mergeWith': true,
  794. },
  795. 'set': {
  796. 'set': true,
  797. 'setWith': true,
  798. 'unset': true,
  799. 'update': true,
  800. 'updateWith': true
  801. }
  802. };
  803. /** Used to track methods with placeholder support */
  804. exports.placeholder = {
  805. 'bind': true,
  806. 'bindKey': true,
  807. 'curry': true,
  808. 'curryRight': true,
  809. 'partial': true,
  810. 'partialRight': true
  811. };
  812. /** Used to map real names to their aliases. */
  813. exports.realToAlias = (function() {
  814. var hasOwnProperty = Object.prototype.hasOwnProperty,
  815. object = exports.aliasToReal,
  816. result = {};
  817. for (var key in object) {
  818. var value = object[key];
  819. if (hasOwnProperty.call(result, value)) {
  820. result[value].push(key);
  821. } else {
  822. result[value] = [key];
  823. }
  824. }
  825. return result;
  826. }());
  827. /** Used to map method names to other names. */
  828. exports.remap = {
  829. 'assignAll': 'assign',
  830. 'assignAllWith': 'assignWith',
  831. 'assignInAll': 'assignIn',
  832. 'assignInAllWith': 'assignInWith',
  833. 'curryN': 'curry',
  834. 'curryRightN': 'curryRight',
  835. 'defaultsAll': 'defaults',
  836. 'defaultsDeepAll': 'defaultsDeep',
  837. 'findFrom': 'find',
  838. 'findIndexFrom': 'findIndex',
  839. 'findLastFrom': 'findLast',
  840. 'findLastIndexFrom': 'findLastIndex',
  841. 'getOr': 'get',
  842. 'includesFrom': 'includes',
  843. 'indexOfFrom': 'indexOf',
  844. 'invokeArgs': 'invoke',
  845. 'invokeArgsMap': 'invokeMap',
  846. 'lastIndexOfFrom': 'lastIndexOf',
  847. 'mergeAll': 'merge',
  848. 'mergeAllWith': 'mergeWith',
  849. 'padChars': 'pad',
  850. 'padCharsEnd': 'padEnd',
  851. 'padCharsStart': 'padStart',
  852. 'propertyOf': 'get',
  853. 'restFrom': 'rest',
  854. 'spreadFrom': 'spread',
  855. 'trimChars': 'trim',
  856. 'trimCharsEnd': 'trimEnd',
  857. 'trimCharsStart': 'trimStart',
  858. 'zipAll': 'zip'
  859. };
  860. /** Used to track methods that skip fixing their arity. */
  861. exports.skipFixed = {
  862. 'castArray': true,
  863. 'flow': true,
  864. 'flowRight': true,
  865. 'iteratee': true,
  866. 'mixin': true,
  867. 'rearg': true,
  868. 'runInContext': true
  869. };
  870. /** Used to track methods that skip rearranging arguments. */
  871. exports.skipRearg = {
  872. 'add': true,
  873. 'assign': true,
  874. 'assignIn': true,
  875. 'bind': true,
  876. 'bindKey': true,
  877. 'concat': true,
  878. 'difference': true,
  879. 'divide': true,
  880. 'eq': true,
  881. 'gt': true,
  882. 'gte': true,
  883. 'isEqual': true,
  884. 'lt': true,
  885. 'lte': true,
  886. 'matchesProperty': true,
  887. 'merge': true,
  888. 'multiply': true,
  889. 'overArgs': true,
  890. 'partial': true,
  891. 'partialRight': true,
  892. 'propertyOf': true,
  893. 'random': true,
  894. 'range': true,
  895. 'rangeRight': true,
  896. 'subtract': true,
  897. 'zip': true,
  898. 'zipObject': true,
  899. 'zipObjectDeep': true
  900. };
  901. /***/ },
  902. /* 3 */
  903. /***/ function(module, exports) {
  904. /**
  905. * The default argument placeholder value for methods.
  906. *
  907. * @type {Object}
  908. */
  909. module.exports = {};
  910. /***/ }
  911. /******/ ])
  912. });
  913. ;