lodash.fp.js 29 KB

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