lodash.fp.js 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879
  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 immutWrap(func, cloner) {
  132. return function() {
  133. var length = arguments.length;
  134. if (!length) {
  135. return result;
  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. 'toPath': util.toPath
  199. };
  200. var ary = helpers.ary,
  201. assign = helpers.assign,
  202. clone = helpers.clone,
  203. curry = helpers.curry,
  204. each = helpers.forEach,
  205. isArray = helpers.isArray,
  206. isFunction = helpers.isFunction,
  207. keys = helpers.keys,
  208. rearg = helpers.rearg,
  209. spread = helpers.spread,
  210. toPath = helpers.toPath;
  211. var aryMethodKeys = keys(mapping.aryMethod);
  212. var wrappers = {
  213. 'castArray': function(castArray) {
  214. return function() {
  215. var value = arguments[0];
  216. return isArray(value)
  217. ? castArray(cloneArray(value))
  218. : castArray.apply(undefined, arguments);
  219. };
  220. },
  221. 'iteratee': function(iteratee) {
  222. return function() {
  223. var func = arguments[0],
  224. arity = arguments[1],
  225. result = iteratee(func, arity),
  226. length = result.length;
  227. if (config.cap && typeof arity == 'number') {
  228. arity = arity > 2 ? (arity - 2) : 1;
  229. return (length && length <= arity) ? result : baseAry(result, arity);
  230. }
  231. return result;
  232. };
  233. },
  234. 'mixin': function(mixin) {
  235. return function(source) {
  236. var func = this;
  237. if (!isFunction(func)) {
  238. return mixin(func, Object(source));
  239. }
  240. var pairs = [];
  241. each(keys(source), function(key) {
  242. if (isFunction(source[key])) {
  243. pairs.push([key, func.prototype[key]]);
  244. }
  245. });
  246. mixin(func, Object(source));
  247. each(pairs, function(pair) {
  248. var value = pair[1];
  249. if (isFunction(value)) {
  250. func.prototype[pair[0]] = value;
  251. } else {
  252. delete func.prototype[pair[0]];
  253. }
  254. });
  255. return func;
  256. };
  257. },
  258. 'runInContext': function(runInContext) {
  259. return function(context) {
  260. return baseConvert(util, runInContext(context), options);
  261. };
  262. }
  263. };
  264. /*--------------------------------------------------------------------------*/
  265. /**
  266. * Creates a clone of `object` by `path`.
  267. *
  268. * @private
  269. * @param {Object} object The object to clone.
  270. * @param {Array|string} path The path to clone by.
  271. * @returns {Object} Returns the cloned object.
  272. */
  273. function cloneByPath(object, path) {
  274. path = toPath(path);
  275. var index = -1,
  276. length = path.length,
  277. lastIndex = length - 1,
  278. result = clone(Object(object)),
  279. nested = result;
  280. while (nested != null && ++index < length) {
  281. var key = path[index],
  282. value = nested[key];
  283. if (value != null) {
  284. nested[path[index]] = clone(index == lastIndex ? value : Object(value));
  285. }
  286. nested = nested[key];
  287. }
  288. return result;
  289. }
  290. /**
  291. * Converts `lodash` to an immutable auto-curried iteratee-first data-last
  292. * version with conversion `options` applied.
  293. *
  294. * @param {Object} [options] The options object. See `baseConvert` for more details.
  295. * @returns {Function} Returns the converted `lodash`.
  296. */
  297. function convertLib(options) {
  298. return _.runInContext.convert(options)(undefined);
  299. }
  300. /**
  301. * Create a converter function for `func` of `name`.
  302. *
  303. * @param {string} name The name of the function to convert.
  304. * @param {Function} func The function to convert.
  305. * @returns {Function} Returns the new converter function.
  306. */
  307. function createConverter(name, func) {
  308. var oldOptions = options;
  309. return function(options) {
  310. var newUtil = isLib ? pristine : helpers,
  311. newFunc = isLib ? pristine[name] : func,
  312. newOptions = assign(assign({}, oldOptions), options);
  313. return baseConvert(newUtil, name, newFunc, newOptions);
  314. };
  315. }
  316. /**
  317. * Creates a function that wraps `func` to invoke its iteratee, with up to `n`
  318. * arguments, ignoring any additional arguments.
  319. *
  320. * @private
  321. * @param {Function} func The function to cap iteratee arguments for.
  322. * @param {number} n The arity cap.
  323. * @returns {Function} Returns the new function.
  324. */
  325. function iterateeAry(func, n) {
  326. return overArg(func, function(func) {
  327. return typeof func == 'function' ? baseAry(func, n) : func;
  328. });
  329. }
  330. /**
  331. * Creates a function that wraps `func` to invoke its iteratee with arguments
  332. * arranged according to the specified `indexes` where the argument value at
  333. * the first index is provided as the first argument, the argument value at
  334. * the second index is provided as the second argument, and so on.
  335. *
  336. * @private
  337. * @param {Function} func The function to rearrange iteratee arguments for.
  338. * @param {number[]} indexes The arranged argument indexes.
  339. * @returns {Function} Returns the new function.
  340. */
  341. function iterateeRearg(func, indexes) {
  342. return overArg(func, function(func) {
  343. var n = indexes.length;
  344. return baseArity(rearg(baseAry(func, n), indexes), n);
  345. });
  346. }
  347. /**
  348. * Creates a function that invokes `func` with its first argument passed
  349. * thru `transform`.
  350. *
  351. * @private
  352. * @param {Function} func The function to wrap.
  353. * @param {...Function} transform The functions to transform the first argument.
  354. * @returns {Function} Returns the new function.
  355. */
  356. function overArg(func, transform) {
  357. return function() {
  358. var length = arguments.length;
  359. if (!length) {
  360. return func();
  361. }
  362. var args = Array(length);
  363. while (length--) {
  364. args[length] = arguments[length];
  365. }
  366. var index = config.rearg ? 0 : (length - 1);
  367. args[index] = transform(args[index]);
  368. return func.apply(undefined, args);
  369. };
  370. }
  371. /**
  372. * Creates a function that wraps `func` and applys the conversions
  373. * rules by `name`.
  374. *
  375. * @private
  376. * @param {string} name The name of the function to wrap.
  377. * @param {Function} func The function to wrap.
  378. * @returns {Function} Returns the converted function.
  379. */
  380. function wrap(name, func) {
  381. name = mapping.aliasToReal[name] || name;
  382. var result,
  383. wrapped = func,
  384. wrapper = wrappers[name];
  385. if (wrapper) {
  386. wrapped = wrapper(func);
  387. }
  388. else if (config.immutable) {
  389. if (mutateMap.array[name]) {
  390. wrapped = immutWrap(func, cloneArray);
  391. }
  392. else if (mutateMap.object[name]) {
  393. wrapped = immutWrap(func, createCloner(func));
  394. }
  395. else if (mutateMap.set[name]) {
  396. wrapped = immutWrap(func, cloneByPath);
  397. }
  398. }
  399. each(aryMethodKeys, function(aryKey) {
  400. each(mapping.aryMethod[aryKey], function(otherName) {
  401. if (name == otherName) {
  402. var aryN = !isLib && mapping.iterateeAry[name],
  403. reargIndexes = mapping.iterateeRearg[name],
  404. spreadStart = mapping.methodSpread[name];
  405. result = wrapped;
  406. if (config.fixed && (forceFixed || !mapping.skipFixed[name])) {
  407. result = spreadStart === undefined
  408. ? ary(result, aryKey)
  409. : spread(result, spreadStart);
  410. }
  411. if (config.rearg && aryKey > 1 && (forceRearg || !mapping.skipRearg[name])) {
  412. result = rearg(result, mapping.methodRearg[name] || mapping.aryRearg[aryKey]);
  413. }
  414. if (config.cap) {
  415. if (reargIndexes) {
  416. result = iterateeRearg(result, reargIndexes);
  417. } else if (aryN) {
  418. result = iterateeAry(result, aryN);
  419. }
  420. }
  421. if (forceCurry || (config.curry && aryKey > 1)) {
  422. forceCurry && console.log(forceCurry, name);
  423. result = curry(result, aryKey);
  424. }
  425. return false;
  426. }
  427. });
  428. return !result;
  429. });
  430. result || (result = wrapped);
  431. if (result == func) {
  432. result = forceCurry ? curry(result, 1) : function() {
  433. return func.apply(this, arguments);
  434. };
  435. }
  436. result.convert = createConverter(name, func);
  437. if (mapping.placeholder[name]) {
  438. setPlaceholder = true;
  439. result.placeholder = func.placeholder = placeholder;
  440. }
  441. return result;
  442. }
  443. /*--------------------------------------------------------------------------*/
  444. if (!isObj) {
  445. return wrap(name, func);
  446. }
  447. var _ = func;
  448. // Convert methods by ary cap.
  449. var pairs = [];
  450. each(aryMethodKeys, function(aryKey) {
  451. each(mapping.aryMethod[aryKey], function(key) {
  452. var func = _[mapping.remap[key] || key];
  453. if (func) {
  454. pairs.push([key, wrap(key, func)]);
  455. }
  456. });
  457. });
  458. // Convert remaining methods.
  459. each(keys(_), function(key) {
  460. var func = _[key];
  461. if (typeof func == 'function') {
  462. var length = pairs.length;
  463. while (length--) {
  464. if (pairs[length][0] == key) {
  465. return;
  466. }
  467. }
  468. func.convert = createConverter(key, func);
  469. pairs.push([key, func]);
  470. }
  471. });
  472. // Assign to `_` leaving `_.prototype` unchanged to allow chaining.
  473. each(pairs, function(pair) {
  474. _[pair[0]] = pair[1];
  475. });
  476. _.convert = convertLib;
  477. if (setPlaceholder) {
  478. _.placeholder = placeholder;
  479. }
  480. // Assign aliases.
  481. each(keys(_), function(key) {
  482. each(mapping.realToAlias[key] || [], function(alias) {
  483. _[alias] = _[key];
  484. });
  485. });
  486. return _;
  487. }
  488. module.exports = baseConvert;
  489. /***/ },
  490. /* 2 */
  491. /***/ function(module, exports) {
  492. /** Used to map aliases to their real names. */
  493. exports.aliasToReal = {
  494. // Lodash aliases.
  495. 'each': 'forEach',
  496. 'eachRight': 'forEachRight',
  497. 'entries': 'toPairs',
  498. 'entriesIn': 'toPairsIn',
  499. 'extend': 'assignIn',
  500. 'extendWith': 'assignInWith',
  501. 'first': 'head',
  502. // Ramda aliases.
  503. '__': 'placeholder',
  504. 'all': 'every',
  505. 'allPass': 'overEvery',
  506. 'always': 'constant',
  507. 'any': 'some',
  508. 'anyPass': 'overSome',
  509. 'apply': 'spread',
  510. 'assoc': 'set',
  511. 'assocPath': 'set',
  512. 'complement': 'negate',
  513. 'compose': 'flowRight',
  514. 'contains': 'includes',
  515. 'dissoc': 'unset',
  516. 'dissocPath': 'unset',
  517. 'equals': 'isEqual',
  518. 'identical': 'eq',
  519. 'init': 'initial',
  520. 'invertObj': 'invert',
  521. 'juxt': 'over',
  522. 'omitAll': 'omit',
  523. 'nAry': 'ary',
  524. 'path': 'get',
  525. 'pathEq': 'matchesProperty',
  526. 'pathOr': 'getOr',
  527. 'paths': 'at',
  528. 'pickAll': 'pick',
  529. 'pipe': 'flow',
  530. 'pluck': 'map',
  531. 'prop': 'get',
  532. 'propEq': 'matchesProperty',
  533. 'propOr': 'getOr',
  534. 'props': 'at',
  535. 'unapply': 'rest',
  536. 'unnest': 'flatten',
  537. 'useWith': 'overArgs',
  538. 'whereEq': 'filter',
  539. 'zipObj': 'zipObject'
  540. };
  541. /** Used to map ary to method names. */
  542. exports.aryMethod = {
  543. '1': [
  544. 'attempt', 'castArray', 'ceil', 'create', 'curry', 'curryRight', 'floor',
  545. 'flow', 'flowRight', 'fromPairs', 'invert', 'iteratee', 'memoize', 'method',
  546. 'methodOf', 'mixin', 'over', 'overEvery', 'overSome', 'rest', 'reverse',
  547. 'round', 'runInContext', 'spread', 'template', 'trim', 'trimEnd', 'trimStart',
  548. 'uniqueId', 'words'
  549. ],
  550. '2': [
  551. 'add', 'after', 'ary', 'assign', 'assignIn', 'at', 'before', 'bind', 'bindAll',
  552. 'bindKey', 'chunk', 'cloneDeepWith', 'cloneWith', 'concat', 'countBy', 'curryN',
  553. 'curryRightN', 'debounce', 'defaults', 'defaultsDeep', 'delay', 'difference',
  554. 'divide', 'drop', 'dropRight', 'dropRightWhile', 'dropWhile', 'endsWith',
  555. 'eq', 'every', 'filter', 'find', 'findIndex', 'findKey', 'findLast',
  556. 'findLastIndex', 'findLastKey', 'flatMap', 'flatMapDeep', 'flattenDepth',
  557. 'forEach', 'forEachRight', 'forIn', 'forInRight', 'forOwn', 'forOwnRight',
  558. 'get', 'groupBy', 'gt', 'gte', 'has', 'hasIn', 'includes', 'indexOf',
  559. 'intersection', 'invertBy', 'invoke', 'invokeMap', 'isEqual', 'isMatch',
  560. 'join', 'keyBy', 'lastIndexOf', 'lt', 'lte', 'map', 'mapKeys', 'mapValues',
  561. 'matchesProperty', 'maxBy', 'meanBy', 'merge', 'minBy', 'multiply', 'nth',
  562. 'omit', 'omitBy', 'overArgs', 'pad', 'padEnd', 'padStart', 'parseInt',
  563. 'partial', 'partialRight', 'partition', 'pick', 'pickBy', 'pull', 'pullAll',
  564. 'pullAt', 'random', 'range', 'rangeRight', 'rearg', 'reject', 'remove',
  565. 'repeat', 'restFrom', 'result', 'sampleSize', 'some', 'sortBy', 'sortedIndex',
  566. 'sortedIndexOf', 'sortedLastIndex', 'sortedLastIndexOf', 'sortedUniqBy',
  567. 'split', 'spreadFrom', 'startsWith', 'subtract', 'sumBy', 'take', 'takeRight',
  568. 'takeRightWhile', 'takeWhile', 'tap', 'throttle', 'thru', 'times', 'trimChars',
  569. 'trimCharsEnd', 'trimCharsStart', 'truncate', 'union', 'uniqBy', 'uniqWith',
  570. 'unset', 'unzipWith', 'without', 'wrap', 'xor', 'zip', 'zipObject',
  571. 'zipObjectDeep'
  572. ],
  573. '3': [
  574. 'assignInWith', 'assignWith', 'clamp', 'differenceBy', 'differenceWith',
  575. 'findFrom', 'findIndexFrom', 'findLastFrom', 'findLastIndexFrom', 'getOr',
  576. 'includesFrom', 'indexOfFrom', 'inRange', 'intersectionBy', 'intersectionWith',
  577. 'invokeArgs', 'invokeArgsMap', 'isEqualWith', 'isMatchWith', 'flatMapDepth',
  578. 'lastIndexOfFrom', 'mergeWith', 'orderBy', 'padChars', 'padCharsEnd',
  579. 'padCharsStart', 'pullAllBy', 'pullAllWith', 'reduce', 'reduceRight', 'replace',
  580. 'set', 'slice', 'sortedIndexBy', 'sortedLastIndexBy', 'transform', 'unionBy',
  581. 'unionWith', 'update', 'xorBy', 'xorWith', 'zipWith'
  582. ],
  583. '4': [
  584. 'fill', 'setWith', 'updateWith'
  585. ]
  586. };
  587. /** Used to map ary to rearg configs. */
  588. exports.aryRearg = {
  589. '2': [1, 0],
  590. '3': [2, 0, 1],
  591. '4': [3, 2, 0, 1]
  592. };
  593. /** Used to map method names to their iteratee ary. */
  594. exports.iterateeAry = {
  595. 'dropRightWhile': 1,
  596. 'dropWhile': 1,
  597. 'every': 1,
  598. 'filter': 1,
  599. 'find': 1,
  600. 'findFrom': 1,
  601. 'findIndex': 1,
  602. 'findIndexFrom': 1,
  603. 'findKey': 1,
  604. 'findLast': 1,
  605. 'findLastFrom': 1,
  606. 'findLastIndex': 1,
  607. 'findLastIndexFrom': 1,
  608. 'findLastKey': 1,
  609. 'flatMap': 1,
  610. 'flatMapDeep': 1,
  611. 'flatMapDepth': 1,
  612. 'forEach': 1,
  613. 'forEachRight': 1,
  614. 'forIn': 1,
  615. 'forInRight': 1,
  616. 'forOwn': 1,
  617. 'forOwnRight': 1,
  618. 'map': 1,
  619. 'mapKeys': 1,
  620. 'mapValues': 1,
  621. 'partition': 1,
  622. 'reduce': 2,
  623. 'reduceRight': 2,
  624. 'reject': 1,
  625. 'remove': 1,
  626. 'some': 1,
  627. 'takeRightWhile': 1,
  628. 'takeWhile': 1,
  629. 'times': 1,
  630. 'transform': 2
  631. };
  632. /** Used to map method names to iteratee rearg configs. */
  633. exports.iterateeRearg = {
  634. 'mapKeys': [1]
  635. };
  636. /** Used to map method names to rearg configs. */
  637. exports.methodRearg = {
  638. 'assignInWith': [1, 2, 0],
  639. 'assignWith': [1, 2, 0],
  640. 'differenceBy': [1, 2, 0],
  641. 'differenceWith': [1, 2, 0],
  642. 'getOr': [2, 1, 0],
  643. 'intersectionBy': [1, 2, 0],
  644. 'intersectionWith': [1, 2, 0],
  645. 'isEqualWith': [1, 2, 0],
  646. 'isMatchWith': [2, 1, 0],
  647. 'mergeWith': [1, 2, 0],
  648. 'padChars': [2, 1, 0],
  649. 'padCharsEnd': [2, 1, 0],
  650. 'padCharsStart': [2, 1, 0],
  651. 'pullAllBy': [2, 1, 0],
  652. 'pullAllWith': [2, 1, 0],
  653. 'setWith': [3, 1, 2, 0],
  654. 'sortedIndexBy': [2, 1, 0],
  655. 'sortedLastIndexBy': [2, 1, 0],
  656. 'unionBy': [1, 2, 0],
  657. 'unionWith': [1, 2, 0],
  658. 'updateWith': [3, 1, 2, 0],
  659. 'xorBy': [1, 2, 0],
  660. 'xorWith': [1, 2, 0],
  661. 'zipWith': [1, 2, 0]
  662. };
  663. /** Used to map method names to spread configs. */
  664. exports.methodSpread = {
  665. 'invokeArgs': 2,
  666. 'invokeArgsMap': 2,
  667. 'partial': 1,
  668. 'partialRight': 1,
  669. 'without': 1
  670. };
  671. /** Used to identify methods which mutate arrays or objects. */
  672. exports.mutate = {
  673. 'array': {
  674. 'fill': true,
  675. 'pull': true,
  676. 'pullAll': true,
  677. 'pullAllBy': true,
  678. 'pullAllWith': true,
  679. 'pullAt': true,
  680. 'remove': true,
  681. 'reverse': true
  682. },
  683. 'object': {
  684. 'assign': true,
  685. 'assignIn': true,
  686. 'assignInWith': true,
  687. 'assignWith': true,
  688. 'defaults': true,
  689. 'defaultsDeep': true,
  690. 'merge': true,
  691. 'mergeWith': true
  692. },
  693. 'set': {
  694. 'set': true,
  695. 'setWith': true,
  696. 'unset': true,
  697. 'update': true,
  698. 'updateWith': true
  699. }
  700. };
  701. /** Used to track methods with placeholder support */
  702. exports.placeholder = {
  703. 'bind': true,
  704. 'bindKey': true,
  705. 'curry': true,
  706. 'curryRight': true,
  707. 'partial': true,
  708. 'partialRight': true
  709. };
  710. /** Used to map real names to their aliases. */
  711. exports.realToAlias = (function() {
  712. var hasOwnProperty = Object.prototype.hasOwnProperty,
  713. object = exports.aliasToReal,
  714. result = {};
  715. for (var key in object) {
  716. var value = object[key];
  717. if (hasOwnProperty.call(result, value)) {
  718. result[value].push(key);
  719. } else {
  720. result[value] = [key];
  721. }
  722. }
  723. return result;
  724. }());
  725. /** Used to map method names to other names. */
  726. exports.remap = {
  727. 'curryN': 'curry',
  728. 'curryRightN': 'curryRight',
  729. 'findFrom': 'find',
  730. 'findIndexFrom': 'findIndex',
  731. 'findLastFrom': 'findLast',
  732. 'findLastIndexFrom': 'findLastIndex',
  733. 'getOr': 'get',
  734. 'includesFrom': 'includes',
  735. 'indexOfFrom': 'indexOf',
  736. 'invokeArgs': 'invoke',
  737. 'invokeArgsMap': 'invokeMap',
  738. 'lastIndexOfFrom': 'lastIndexOf',
  739. 'padChars': 'pad',
  740. 'padCharsEnd': 'padEnd',
  741. 'padCharsStart': 'padStart',
  742. 'restFrom': 'rest',
  743. 'spreadFrom': 'spread',
  744. 'trimChars': 'trim',
  745. 'trimCharsEnd': 'trimEnd',
  746. 'trimCharsStart': 'trimStart'
  747. };
  748. /** Used to track methods that skip fixing their arity. */
  749. exports.skipFixed = {
  750. 'castArray': true,
  751. 'flow': true,
  752. 'flowRight': true,
  753. 'iteratee': true,
  754. 'mixin': true,
  755. 'runInContext': true
  756. };
  757. /** Used to track methods that skip rearranging arguments. */
  758. exports.skipRearg = {
  759. 'add': true,
  760. 'assign': true,
  761. 'assignIn': true,
  762. 'bind': true,
  763. 'bindKey': true,
  764. 'concat': true,
  765. 'difference': true,
  766. 'divide': true,
  767. 'eq': true,
  768. 'gt': true,
  769. 'gte': true,
  770. 'isEqual': true,
  771. 'lt': true,
  772. 'lte': true,
  773. 'matchesProperty': true,
  774. 'merge': true,
  775. 'multiply': true,
  776. 'overArgs': true,
  777. 'partial': true,
  778. 'partialRight': true,
  779. 'random': true,
  780. 'range': true,
  781. 'rangeRight': true,
  782. 'subtract': true,
  783. 'zip': true,
  784. 'zipObject': true
  785. };
  786. /***/ },
  787. /* 3 */
  788. /***/ function(module, exports) {
  789. /**
  790. * The default argument placeholder value for methods.
  791. *
  792. * @type {Object}
  793. */
  794. module.exports = {};
  795. /***/ }
  796. /******/ ])
  797. });
  798. ;