rubico 2.7.2 → 2.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (495) hide show
  1. package/README.md +14 -17
  2. package/Transducer.d.ts +10 -10
  3. package/Transducer.js +65 -69
  4. package/__.js +1 -1
  5. package/_internal/FlatMappingIterator.js +1 -1
  6. package/_internal/MappingIterator.d.ts +1 -1
  7. package/_internal/MappingIterator.js +1 -1
  8. package/_internal/arrayFilter.js +6 -6
  9. package/_internal/arrayFilterIndexes.js +7 -7
  10. package/_internal/arrayFilterWithIndex.js +6 -6
  11. package/_internal/arrayFind.js +7 -7
  12. package/_internal/arrayFlatten.js +25 -25
  13. package/_internal/arrayForEach.d.ts +1 -1
  14. package/_internal/arrayForEach.js +1 -1
  15. package/_internal/arrayForEachSeries.js +1 -1
  16. package/_internal/arrayMap.d.ts +2 -2
  17. package/_internal/arrayMap.js +5 -5
  18. package/_internal/arrayMapPool.d.ts +1 -1
  19. package/_internal/arrayMapPool.js +10 -10
  20. package/_internal/arrayMapRate.js +4 -4
  21. package/_internal/arrayMapSeries.d.ts +1 -1
  22. package/_internal/arrayMapSeries.js +8 -8
  23. package/_internal/arrayMapWithIndex.js +4 -4
  24. package/_internal/arrayReduce.js +1 -1
  25. package/_internal/asyncGeneratorFunctionForEach.js +3 -3
  26. package/_internal/asyncGeneratorFunctionMap.js +3 -3
  27. package/_internal/asyncIteratorFind.js +3 -3
  28. package/_internal/asyncIteratorForEach.d.ts +1 -1
  29. package/_internal/asyncIteratorForEach.js +3 -3
  30. package/_internal/asyncIteratorForEachSeries.js +3 -3
  31. package/_internal/asyncIteratorToArray.js +2 -2
  32. package/_internal/copyDeep.js +12 -12
  33. package/_internal/funcAll.js +3 -3
  34. package/_internal/funcAllSeries.js +6 -6
  35. package/_internal/funcObjectAll.js +4 -4
  36. package/_internal/functionArrayAll.js +3 -3
  37. package/_internal/functionArrayAllSeries.js +6 -6
  38. package/_internal/functionObjectAll.js +4 -4
  39. package/_internal/generatorFunctionForEach.js +3 -3
  40. package/_internal/generatorFunctionMap.js +3 -3
  41. package/_internal/generatorFunctionReduce.js +1 -1
  42. package/_internal/iteratorEvery.js +2 -2
  43. package/_internal/iteratorFind.js +7 -7
  44. package/_internal/iteratorForEach.d.ts +1 -1
  45. package/_internal/iteratorForEach.js +3 -3
  46. package/_internal/iteratorForEachSeries.js +1 -1
  47. package/_internal/iteratorReduce.d.ts +1 -1
  48. package/_internal/iteratorReduce.js +2 -2
  49. package/_internal/iteratorSome.js +2 -2
  50. package/_internal/mapFilter.js +4 -4
  51. package/_internal/mapMap.d.ts +1 -1
  52. package/_internal/mapMap.js +6 -6
  53. package/_internal/mapMapPool.js +10 -10
  54. package/_internal/mapMapSeries.js +10 -10
  55. package/_internal/objectFilter.js +6 -6
  56. package/_internal/objectFlatMap.d.ts +1 -1
  57. package/_internal/objectFlatMap.js +1 -1
  58. package/_internal/objectFlatten.js +14 -14
  59. package/_internal/objectMap.js +3 -3
  60. package/_internal/objectMapOwn.js +3 -3
  61. package/_internal/objectMapPool.js +10 -10
  62. package/_internal/objectMapSeries.js +9 -9
  63. package/_internal/objectReduce.d.ts +1 -1
  64. package/_internal/objectReduce.js +2 -2
  65. package/_internal/reducerAllSync.d.ts +2 -2
  66. package/_internal/reducerAllSync.js +2 -2
  67. package/_internal/reducerAnySync.d.ts +1 -1
  68. package/_internal/reducerAnySync.js +2 -2
  69. package/_internal/reducerConcat.d.ts +1 -1
  70. package/_internal/reducerConcat.js +4 -4
  71. package/_internal/reducerConcatSync.js +2 -2
  72. package/_internal/reducerEvery.d.ts +2 -2
  73. package/_internal/reducerEvery.js +4 -4
  74. package/_internal/reducerFilter.d.ts +2 -2
  75. package/_internal/reducerFilter.js +5 -5
  76. package/_internal/reducerFlatten.js +3 -3
  77. package/_internal/reducerForEach.d.ts +2 -2
  78. package/_internal/reducerForEach.js +5 -5
  79. package/_internal/reducerMap.d.ts +1 -1
  80. package/_internal/reducerMap.js +5 -5
  81. package/_internal/reducerSome.d.ts +2 -2
  82. package/_internal/reducerSome.js +4 -4
  83. package/_internal/reducerTryCatch.d.ts +2 -2
  84. package/_internal/reducerTryCatch.js +8 -8
  85. package/_internal/setFilter.d.ts +1 -1
  86. package/_internal/setFilter.js +5 -5
  87. package/_internal/setFlatten.js +24 -24
  88. package/_internal/setMap.d.ts +1 -1
  89. package/_internal/setMap.js +6 -6
  90. package/_internal/setMapPool.js +9 -9
  91. package/_internal/setMapSeries.js +10 -10
  92. package/_internal/streamFlatExtend.js +25 -25
  93. package/_internal/streamFlatMap.js +2 -2
  94. package/all.js +29 -30
  95. package/and.js +27 -13
  96. package/assign.js +15 -23
  97. package/compose.js +7 -5
  98. package/curry.js +5 -12
  99. package/dist/Transducer.es.js +24 -24
  100. package/dist/Transducer.es.min.js +1 -1
  101. package/dist/Transducer.js +24 -24
  102. package/dist/Transducer.min.js +1 -1
  103. package/dist/Transducer.mjs +24 -24
  104. package/dist/__.es.js +1 -1
  105. package/dist/__.es.min.js +1 -1
  106. package/dist/__.js +1 -1
  107. package/dist/__.min.js +1 -1
  108. package/dist/__.mjs +1 -1
  109. package/dist/all.es.js +14 -14
  110. package/dist/all.es.min.js +1 -1
  111. package/dist/all.js +14 -14
  112. package/dist/all.min.js +1 -1
  113. package/dist/all.mjs +14 -14
  114. package/dist/always.es.js +1 -1
  115. package/dist/always.es.min.js +1 -1
  116. package/dist/always.js +1 -1
  117. package/dist/always.min.js +1 -1
  118. package/dist/always.mjs +1 -1
  119. package/dist/and.es.js +1 -1
  120. package/dist/and.es.min.js +1 -1
  121. package/dist/and.js +1 -1
  122. package/dist/and.min.js +1 -1
  123. package/dist/and.mjs +1 -1
  124. package/dist/assign.es.js +5 -5
  125. package/dist/assign.es.min.js +1 -1
  126. package/dist/assign.js +5 -5
  127. package/dist/assign.min.js +1 -1
  128. package/dist/assign.mjs +5 -5
  129. package/dist/compose.es.js +1 -1
  130. package/dist/compose.es.min.js +1 -1
  131. package/dist/compose.js +1 -1
  132. package/dist/compose.min.js +1 -1
  133. package/dist/compose.mjs +1 -1
  134. package/dist/curry.es.js +1 -1
  135. package/dist/curry.es.min.js +1 -1
  136. package/dist/curry.js +1 -1
  137. package/dist/curry.min.js +1 -1
  138. package/dist/curry.mjs +1 -1
  139. package/dist/eq.es.js +1 -1
  140. package/dist/eq.es.min.js +1 -1
  141. package/dist/eq.js +1 -1
  142. package/dist/eq.min.js +1 -1
  143. package/dist/eq.mjs +1 -1
  144. package/dist/every.es.js +7 -7
  145. package/dist/every.es.min.js +1 -1
  146. package/dist/every.js +7 -7
  147. package/dist/every.min.js +1 -1
  148. package/dist/every.mjs +7 -7
  149. package/dist/filter.es.js +21 -21
  150. package/dist/filter.es.min.js +1 -1
  151. package/dist/filter.js +21 -21
  152. package/dist/filter.min.js +1 -1
  153. package/dist/filter.mjs +21 -21
  154. package/dist/flatMap.es.js +82 -82
  155. package/dist/flatMap.es.min.js +1 -1
  156. package/dist/flatMap.js +82 -82
  157. package/dist/flatMap.min.js +1 -1
  158. package/dist/flatMap.mjs +82 -82
  159. package/dist/forEach.es.js +7 -7
  160. package/dist/forEach.es.min.js +1 -1
  161. package/dist/forEach.js +7 -7
  162. package/dist/forEach.min.js +1 -1
  163. package/dist/forEach.mjs +7 -7
  164. package/dist/get.es.js +1 -1
  165. package/dist/get.es.min.js +1 -1
  166. package/dist/get.js +1 -1
  167. package/dist/get.min.js +1 -1
  168. package/dist/get.mjs +1 -1
  169. package/dist/gt.es.js +1 -1
  170. package/dist/gt.es.min.js +1 -1
  171. package/dist/gt.js +1 -1
  172. package/dist/gt.min.js +1 -1
  173. package/dist/gt.mjs +1 -1
  174. package/dist/gte.es.js +1 -1
  175. package/dist/gte.es.min.js +1 -1
  176. package/dist/gte.js +1 -1
  177. package/dist/gte.min.js +1 -1
  178. package/dist/gte.mjs +1 -1
  179. package/dist/lt.es.js +1 -1
  180. package/dist/lt.es.min.js +1 -1
  181. package/dist/lt.js +1 -1
  182. package/dist/lt.min.js +1 -1
  183. package/dist/lt.mjs +1 -1
  184. package/dist/lte.es.js +1 -1
  185. package/dist/lte.es.min.js +1 -1
  186. package/dist/lte.js +1 -1
  187. package/dist/lte.min.js +1 -1
  188. package/dist/lte.mjs +1 -1
  189. package/dist/map.es.js +83 -83
  190. package/dist/map.es.min.js +1 -1
  191. package/dist/map.js +83 -83
  192. package/dist/map.min.js +1 -1
  193. package/dist/map.mjs +83 -83
  194. package/dist/not.es.js +4 -2
  195. package/dist/not.es.min.js +2 -2
  196. package/dist/not.js +4 -2
  197. package/dist/not.min.js +2 -2
  198. package/dist/not.mjs +4 -2
  199. package/dist/omit.es.js +13 -13
  200. package/dist/omit.es.min.js +1 -1
  201. package/dist/omit.js +13 -13
  202. package/dist/omit.min.js +1 -1
  203. package/dist/omit.mjs +13 -13
  204. package/dist/or.es.js +1 -1
  205. package/dist/or.es.min.js +1 -1
  206. package/dist/or.js +1 -1
  207. package/dist/or.min.js +1 -1
  208. package/dist/or.mjs +1 -1
  209. package/dist/pick.es.js +1 -1
  210. package/dist/pick.es.min.js +1 -1
  211. package/dist/pick.js +1 -1
  212. package/dist/pick.min.js +1 -1
  213. package/dist/pick.mjs +1 -1
  214. package/dist/pipe.es.js +1 -1
  215. package/dist/pipe.es.min.js +1 -1
  216. package/dist/pipe.js +1 -1
  217. package/dist/pipe.min.js +1 -1
  218. package/dist/pipe.mjs +1 -1
  219. package/dist/reduce.es.js +5 -5
  220. package/dist/reduce.es.min.js +1 -1
  221. package/dist/reduce.js +5 -5
  222. package/dist/reduce.min.js +1 -1
  223. package/dist/reduce.mjs +5 -5
  224. package/dist/rubico.es.js +218 -216
  225. package/dist/rubico.es.min.js +2 -2
  226. package/dist/rubico.global.js +218 -216
  227. package/dist/rubico.global.min.js +2 -2
  228. package/dist/rubico.js +218 -216
  229. package/dist/rubico.min.js +2 -2
  230. package/dist/rubico.mjs +218 -216
  231. package/dist/set.es.js +1 -1
  232. package/dist/set.es.min.js +1 -1
  233. package/dist/set.js +1 -1
  234. package/dist/set.min.js +1 -1
  235. package/dist/set.mjs +1 -1
  236. package/dist/some.es.js +8 -8
  237. package/dist/some.es.min.js +1 -1
  238. package/dist/some.js +8 -8
  239. package/dist/some.min.js +1 -1
  240. package/dist/some.mjs +8 -8
  241. package/dist/switchCase.es.js +1 -1
  242. package/dist/switchCase.es.min.js +1 -1
  243. package/dist/switchCase.js +1 -1
  244. package/dist/switchCase.min.js +1 -1
  245. package/dist/switchCase.mjs +1 -1
  246. package/dist/tap.es.js +1 -1
  247. package/dist/tap.es.min.js +1 -1
  248. package/dist/tap.js +1 -1
  249. package/dist/tap.min.js +1 -1
  250. package/dist/tap.mjs +1 -1
  251. package/dist/thunkify.es.js +1 -1
  252. package/dist/thunkify.es.min.js +1 -1
  253. package/dist/thunkify.js +1 -1
  254. package/dist/thunkify.min.js +1 -1
  255. package/dist/thunkify.mjs +1 -1
  256. package/dist/transform.es.js +5 -5
  257. package/dist/transform.es.min.js +1 -1
  258. package/dist/transform.js +5 -5
  259. package/dist/transform.min.js +1 -1
  260. package/dist/transform.mjs +5 -5
  261. package/dist/tryCatch.es.js +1 -1
  262. package/dist/tryCatch.es.min.js +1 -1
  263. package/dist/tryCatch.js +1 -1
  264. package/dist/tryCatch.min.js +1 -1
  265. package/dist/tryCatch.mjs +1 -1
  266. package/dist/x/append.es.js +8 -8
  267. package/dist/x/append.es.min.js +1 -1
  268. package/dist/x/append.js +8 -8
  269. package/dist/x/append.min.js +1 -1
  270. package/dist/x/append.mjs +8 -8
  271. package/dist/x/callProp.es.js +1 -1
  272. package/dist/x/callProp.es.min.js +1 -1
  273. package/dist/x/callProp.js +1 -1
  274. package/dist/x/callProp.min.js +1 -1
  275. package/dist/x/callProp.mjs +1 -1
  276. package/dist/x/defaultsDeep.es.js +69 -37
  277. package/dist/x/defaultsDeep.es.min.js +2 -2
  278. package/dist/x/defaultsDeep.js +69 -37
  279. package/dist/x/defaultsDeep.min.js +2 -2
  280. package/dist/x/defaultsDeep.mjs +69 -37
  281. package/dist/x/differenceWith.es.js +14 -14
  282. package/dist/x/differenceWith.es.min.js +1 -1
  283. package/dist/x/differenceWith.js +14 -14
  284. package/dist/x/differenceWith.min.js +1 -1
  285. package/dist/x/differenceWith.mjs +14 -14
  286. package/dist/x/filterOut.es.js +24 -22
  287. package/dist/x/filterOut.es.min.js +2 -2
  288. package/dist/x/filterOut.js +24 -22
  289. package/dist/x/filterOut.min.js +2 -2
  290. package/dist/x/filterOut.mjs +24 -22
  291. package/dist/x/find.es.js +18 -18
  292. package/dist/x/find.es.min.js +1 -1
  293. package/dist/x/find.js +18 -18
  294. package/dist/x/find.min.js +1 -1
  295. package/dist/x/find.mjs +18 -18
  296. package/dist/x/findIndex.es.js +1 -1
  297. package/dist/x/findIndex.es.min.js +1 -1
  298. package/dist/x/findIndex.js +1 -1
  299. package/dist/x/findIndex.min.js +1 -1
  300. package/dist/x/findIndex.mjs +1 -1
  301. package/dist/x/first.es.js +1 -1
  302. package/dist/x/first.es.min.js +1 -1
  303. package/dist/x/first.js +1 -1
  304. package/dist/x/first.min.js +1 -1
  305. package/dist/x/first.mjs +1 -1
  306. package/dist/x/flatten.es.js +82 -82
  307. package/dist/x/flatten.es.min.js +1 -1
  308. package/dist/x/flatten.js +82 -82
  309. package/dist/x/flatten.min.js +1 -1
  310. package/dist/x/flatten.mjs +82 -82
  311. package/dist/x/groupBy.es.js +17 -17
  312. package/dist/x/groupBy.es.min.js +1 -1
  313. package/dist/x/groupBy.js +17 -17
  314. package/dist/x/groupBy.min.js +1 -1
  315. package/dist/x/groupBy.mjs +17 -17
  316. package/dist/x/has.es.js +1 -1
  317. package/dist/x/has.es.min.js +1 -1
  318. package/dist/x/has.js +1 -1
  319. package/dist/x/has.min.js +1 -1
  320. package/dist/x/has.mjs +1 -1
  321. package/dist/x/identity.es.js +1 -1
  322. package/dist/x/identity.es.min.js +1 -1
  323. package/dist/x/identity.js +1 -1
  324. package/dist/x/identity.min.js +1 -1
  325. package/dist/x/identity.mjs +1 -1
  326. package/dist/x/includes.es.js +1 -1
  327. package/dist/x/includes.es.min.js +1 -1
  328. package/dist/x/includes.js +1 -1
  329. package/dist/x/includes.min.js +1 -1
  330. package/dist/x/includes.mjs +1 -1
  331. package/dist/x/isDeepEqual.es.js +1 -1
  332. package/dist/x/isDeepEqual.es.min.js +1 -1
  333. package/dist/x/isDeepEqual.js +1 -1
  334. package/dist/x/isDeepEqual.min.js +1 -1
  335. package/dist/x/isDeepEqual.mjs +1 -1
  336. package/dist/x/isEmpty.es.js +1 -1
  337. package/dist/x/isEmpty.es.min.js +1 -1
  338. package/dist/x/isEmpty.js +1 -1
  339. package/dist/x/isEmpty.min.js +1 -1
  340. package/dist/x/isEmpty.mjs +1 -1
  341. package/dist/x/isEqual.es.js +1 -1
  342. package/dist/x/isEqual.es.min.js +1 -1
  343. package/dist/x/isEqual.js +1 -1
  344. package/dist/x/isEqual.min.js +1 -1
  345. package/dist/x/isEqual.mjs +1 -1
  346. package/dist/x/isFunction.es.js +1 -1
  347. package/dist/x/isFunction.es.min.js +1 -1
  348. package/dist/x/isFunction.js +1 -1
  349. package/dist/x/isFunction.min.js +1 -1
  350. package/dist/x/isFunction.mjs +1 -1
  351. package/dist/x/isIn.es.js +1 -1
  352. package/dist/x/isIn.es.min.js +1 -1
  353. package/dist/x/isIn.js +1 -1
  354. package/dist/x/isIn.min.js +1 -1
  355. package/dist/x/isIn.mjs +1 -1
  356. package/dist/x/isObject.es.js +1 -1
  357. package/dist/x/isObject.es.min.js +1 -1
  358. package/dist/x/isObject.js +1 -1
  359. package/dist/x/isObject.min.js +1 -1
  360. package/dist/x/isObject.mjs +1 -1
  361. package/dist/x/isString.es.js +1 -1
  362. package/dist/x/isString.es.min.js +1 -1
  363. package/dist/x/isString.js +1 -1
  364. package/dist/x/isString.min.js +1 -1
  365. package/dist/x/isString.mjs +1 -1
  366. package/dist/x/keys.es.js +1 -1
  367. package/dist/x/keys.es.min.js +1 -1
  368. package/dist/x/keys.js +1 -1
  369. package/dist/x/keys.min.js +1 -1
  370. package/dist/x/keys.mjs +1 -1
  371. package/dist/x/last.es.js +1 -1
  372. package/dist/x/last.es.min.js +1 -1
  373. package/dist/x/last.js +1 -1
  374. package/dist/x/last.min.js +1 -1
  375. package/dist/x/last.mjs +1 -1
  376. package/dist/x/maxBy.es.js +6 -6
  377. package/dist/x/maxBy.es.min.js +1 -1
  378. package/dist/x/maxBy.js +6 -6
  379. package/dist/x/maxBy.min.js +1 -1
  380. package/dist/x/maxBy.mjs +6 -6
  381. package/dist/x/noop.es.js +1 -1
  382. package/dist/x/noop.es.min.js +1 -1
  383. package/dist/x/noop.js +1 -1
  384. package/dist/x/noop.min.js +1 -1
  385. package/dist/x/noop.mjs +1 -1
  386. package/dist/x/pluck.es.js +83 -83
  387. package/dist/x/pluck.es.min.js +1 -1
  388. package/dist/x/pluck.js +83 -83
  389. package/dist/x/pluck.min.js +1 -1
  390. package/dist/x/pluck.mjs +83 -83
  391. package/dist/x/prepend.es.js +8 -8
  392. package/dist/x/prepend.es.min.js +1 -1
  393. package/dist/x/prepend.js +8 -8
  394. package/dist/x/prepend.min.js +1 -1
  395. package/dist/x/prepend.mjs +8 -8
  396. package/dist/x/size.es.js +1 -1
  397. package/dist/x/size.es.min.js +1 -1
  398. package/dist/x/size.js +1 -1
  399. package/dist/x/size.min.js +1 -1
  400. package/dist/x/size.mjs +1 -1
  401. package/dist/x/trace.es.js +1 -1
  402. package/dist/x/trace.es.min.js +1 -1
  403. package/dist/x/trace.js +1 -1
  404. package/dist/x/trace.min.js +1 -1
  405. package/dist/x/trace.mjs +1 -1
  406. package/dist/x/unionWith.es.js +39 -39
  407. package/dist/x/unionWith.es.min.js +1 -1
  408. package/dist/x/unionWith.js +39 -39
  409. package/dist/x/unionWith.min.js +1 -1
  410. package/dist/x/unionWith.mjs +39 -39
  411. package/dist/x/uniq.es.js +1 -1
  412. package/dist/x/uniq.es.min.js +1 -1
  413. package/dist/x/uniq.js +1 -1
  414. package/dist/x/uniq.min.js +1 -1
  415. package/dist/x/uniq.mjs +1 -1
  416. package/dist/x/unless.es.js +1 -1
  417. package/dist/x/unless.es.min.js +1 -1
  418. package/dist/x/unless.js +1 -1
  419. package/dist/x/unless.min.js +1 -1
  420. package/dist/x/unless.mjs +1 -1
  421. package/dist/x/values.es.js +1 -1
  422. package/dist/x/values.es.min.js +1 -1
  423. package/dist/x/values.js +1 -1
  424. package/dist/x/values.min.js +1 -1
  425. package/dist/x/values.mjs +1 -1
  426. package/dist/x/when.es.js +1 -1
  427. package/dist/x/when.es.min.js +1 -1
  428. package/dist/x/when.js +1 -1
  429. package/dist/x/when.min.js +1 -1
  430. package/dist/x/when.mjs +1 -1
  431. package/eq.js +32 -10
  432. package/es.js +218 -216
  433. package/every.d.ts +1 -1
  434. package/every.js +5 -3
  435. package/filter.d.ts +3 -3
  436. package/filter.js +15 -15
  437. package/flatMap.d.ts +9 -9
  438. package/flatMap.js +13 -11
  439. package/forEach.d.ts +1 -1
  440. package/forEach.js +19 -15
  441. package/gt.js +30 -13
  442. package/gte.js +31 -12
  443. package/index.js +218 -216
  444. package/lt.js +28 -9
  445. package/lte.js +34 -15
  446. package/map.d.ts +3 -3
  447. package/map.js +32 -32
  448. package/monad/Mux.benchmark.js +1 -1
  449. package/monad/Mux.js +6 -6
  450. package/monad/Struct.js +2 -2
  451. package/not.js +23 -8
  452. package/omit.js +2 -3
  453. package/or.js +30 -14
  454. package/package.json +1 -1
  455. package/pick.js +2 -3
  456. package/pipe.js +7 -15
  457. package/reduce.d.ts +7 -7
  458. package/reduce.js +19 -24
  459. package/some.d.ts +1 -1
  460. package/some.js +5 -3
  461. package/switchCase.d.ts +1 -1
  462. package/switchCase.js +13 -12
  463. package/tap.js +20 -4
  464. package/thunkify.js +2 -0
  465. package/transform.d.ts +1 -1
  466. package/transform.js +9 -23
  467. package/tryCatch.js +41 -8
  468. package/x/README.md +8 -8
  469. package/x/append.d.ts +2 -2
  470. package/x/append.js +8 -8
  471. package/x/defaultsDeep.js +94 -57
  472. package/x/defaultsDeep.test.js +24 -1
  473. package/x/differenceWith.js +13 -13
  474. package/x/find.d.ts +1 -1
  475. package/x/find.js +1 -1
  476. package/x/find.test.js +2 -2
  477. package/x/findIndex.test.js +1 -1
  478. package/x/first.d.ts +1 -1
  479. package/x/first.js +1 -1
  480. package/x/first.test.js +1 -1
  481. package/x/groupBy.d.ts +1 -1
  482. package/x/groupBy.js +13 -13
  483. package/x/last.d.ts +1 -1
  484. package/x/last.js +1 -1
  485. package/x/last.test.js +1 -1
  486. package/x/maxBy.d.ts +7 -7
  487. package/x/maxBy.js +13 -13
  488. package/x/maxBy.test.js +5 -5
  489. package/x/pluck.test.js +1 -1
  490. package/x/prepend.d.ts +2 -2
  491. package/x/prepend.js +8 -8
  492. package/x/size.d.ts +1 -1
  493. package/x/size.js +1 -1
  494. package/x/unionWith.js +11 -11
  495. package/x/unionWith.test.js +5 -5
package/x/defaultsDeep.js CHANGED
@@ -1,33 +1,35 @@
1
1
  const isArray = require('../_internal/isArray')
2
+ const curry2 = require('../_internal/curry2')
3
+ const __ = require('../_internal/placeholder')
2
4
 
3
5
  /**
4
6
  * @name arrayDefaultsDeepFromArray
5
7
  *
6
8
  * @synopsis
7
9
  * ```coffeescript [specscript]
8
- * var array Array<Array|Object|any>,
9
- * defaultArray Array<Array|Object|any>,
10
- *
11
- * arrayDefaultsDeepFromArray(array, defaultArray) -> Array
10
+ * arrayDefaultsDeepFromArray(
11
+ * data Array<Array|Object|any>,
12
+ * defaults Array<Array|Object|any>
13
+ * ) -> Object
12
14
  * ```
13
15
  */
14
- const arrayDefaultsDeepFromArray = function (array, defaultArray) {
15
- const defaultArrayLength = defaultArray.length,
16
- result = array.slice()
16
+ function arrayDefaultsDeepFromArray(data, defaults) {
17
+ const defaultArrayLength = defaults.length,
18
+ result = data.slice()
17
19
  let index = -1
18
20
  while (++index < defaultArrayLength) {
19
- const item = array[index],
20
- defaultItem = defaultArray[index]
21
- if (isArray(item) && isArray(defaultItem)) {
22
- result[index] = arrayDefaultsDeepFromArray(item, defaultItem)
23
- } else if (item == null) {
24
- result[index] = defaultItem
25
- } else if (defaultItem == null) {
26
- result[index] = item
27
- } else if (item.constructor == Object && defaultItem.constructor == Object) {
28
- result[index] = objectDefaultsDeepFromObject(item, defaultItem)
21
+ const element = data[index],
22
+ defaultElement = defaults[index]
23
+ if (isArray(element) && isArray(defaultElement)) {
24
+ result[index] = arrayDefaultsDeepFromArray(element, defaultElement)
25
+ } else if (element == null) {
26
+ result[index] = defaultElement
27
+ } else if (defaultElement == null) {
28
+ result[index] = element
29
+ } else if (element.constructor == Object && defaultElement.constructor == Object) {
30
+ result[index] = objectDefaultsDeepFromObject(element, defaultElement)
29
31
  } else {
30
- result[index] = item
32
+ result[index] = element
31
33
  }
32
34
  }
33
35
  return result
@@ -38,62 +40,89 @@ const arrayDefaultsDeepFromArray = function (array, defaultArray) {
38
40
  *
39
41
  * @synopsis
40
42
  * ```coffeescript [specscript]
41
- * var object Object<Array|Object|any>,
42
- * defaultObject Object<Array|Object|any>
43
- *
44
- * objectDefaultsDeepFromObject(object, defaultObject) -> Object
43
+ * objectDefaultsDeepFromObject(
44
+ * data Object<Array|Object|any>,
45
+ * defaults Object<Array|Object|any>
46
+ * ) -> Object
45
47
  * ```
46
48
  */
47
- const objectDefaultsDeepFromObject = function (object, defaultObject) {
48
- const result = { ...object }
49
- for (const key in defaultObject) {
50
- const item = object[key],
51
- defaultItem = defaultObject[key]
52
- if (isArray(item) && isArray(defaultItem)) {
53
- result[key] = arrayDefaultsDeepFromArray(item, defaultItem)
54
- } else if (item == null) {
55
- result[key] = defaultItem
56
- } else if (defaultItem == null) {
57
- result[key] = item
58
- } else if (item.constructor == Object && defaultItem.constructor == Object) {
59
- result[key] = objectDefaultsDeepFromObject(item, defaultItem)
49
+ function objectDefaultsDeepFromObject(data, defaults) {
50
+ const result = { ...data }
51
+ for (const key in defaults) {
52
+ const element = data[key],
53
+ defaultElement = defaults[key]
54
+ if (isArray(element) && isArray(defaultElement)) {
55
+ result[key] = arrayDefaultsDeepFromArray(element, defaultElement)
56
+ } else if (element == null) {
57
+ result[key] = defaultElement
58
+ } else if (defaultElement == null) {
59
+ result[key] = element
60
+ } else if (element.constructor == Object && defaultElement.constructor == Object) {
61
+ result[key] = objectDefaultsDeepFromObject(element, defaultElement)
60
62
  } else {
61
- result[key] = item
63
+ result[key] = element
62
64
  }
63
65
  }
64
66
  return result
65
67
  }
66
68
 
69
+ /**
70
+ * @name _defaultsDeep
71
+ *
72
+ * @synopsis
73
+ * ```coffeescript [specscript]
74
+ * _defaultsDeep(
75
+ * data Object<Array|Object|any>,
76
+ * defaults (Object|Array)<Array|Object|any>
77
+ * ) -> result Object
78
+ * ```
79
+ */
80
+ function _defaultsDeep(data, defaults) {
81
+ if (isArray(data) && isArray(defaults)) {
82
+ return arrayDefaultsDeepFromArray(data, defaults)
83
+ }
84
+ if (data == null || defaults == null) {
85
+ return data
86
+ }
87
+ if (data.constructor == Object && defaults.constructor == Object) {
88
+ return objectDefaultsDeepFromObject(data, defaults)
89
+ }
90
+ return data
91
+ }
92
+
67
93
  /**
68
94
  * @name defaultsDeep
69
95
  *
70
96
  * @synopsis
71
97
  * ```coffeescript [specscript]
72
- * var defaultCollection Array|Object,
73
- * value Array|Object
98
+ * data (Object|Array)<Array|Object|any>
99
+ * defaults (Object|Array)<Array|Object|any>
74
100
  *
75
- * defaultsDeep(defaultCollection)(value) -> Array|Object
101
+ * defaultsDeep(data, defaults) -> result Object
102
+ * defaultsDeep(defaults)(data) -> result Object
76
103
  * ```
77
104
  *
78
105
  * @description
79
- * Deeply assign default values to an array or object by an array or object of possibly nested default values.
106
+ * Deeply assign default values to an object or array `data` using an array or object of default values `defaults`. The keys or indices of each element of `defaults` are used to extend `data` where there is no existing value. Both `data` and `defaults` may have nested arrays or objects.
80
107
  *
81
108
  * ```javascript [playground]
82
109
  * import defaultsDeep from 'https://unpkg.com/rubico/dist/x/defaultsDeep.es.js'
83
110
  *
84
- * const defaultUser = defaultsDeep({
111
+ * const user = {
112
+ * name: 'John',
113
+ * images: [{ url: 'https://placehold.co/600x400' }],
114
+ * }
115
+ *
116
+ * const userWithDefaults = defaultsDeep(user, {
85
117
  * name: 'placeholder',
86
118
  * images: [
87
- * { url: 'https://via.placeholder.com/150' },
88
- * { url: 'https://via.placeholder.com/150' },
89
- * { url: 'https://via.placeholder.com/150' },
119
+ * { url: 'https://placehold.co/150' },
120
+ * { url: 'https://placehold.co/150' },
121
+ * { url: 'https://placehold.co/150' },
90
122
  * ],
91
123
  * })
92
124
  *
93
- * console.log(defaultUser({
94
- * name: 'John',
95
- * images: [{ url: 'https://via.placeholder.com/150/0000FF/808080%20?Text=Digital.com' }],
96
- * }))
125
+ * console.log(userWithDefaults)
97
126
  * // {
98
127
  * // name: 'John',
99
128
  * // images: [
@@ -104,22 +133,30 @@ const objectDefaultsDeepFromObject = function (object, defaultObject) {
104
133
  * // }
105
134
  * ```
106
135
  *
136
+ * The `defaults` array or object may be provided to `defaultsDeep` without `data` to create a lazy version of `defaultsDeep` that accepts `data` as a single argument. This "lazy" API can be used for function pipelines and function compositions.
137
+ *
138
+ * ```javascript [playground]
139
+ * pipe({ a: 1 }, [
140
+ * defaultsDeep({ b: 2, c: 3, g: [1, 2, 3] }),
141
+ * console.log, // { a: 1, b: 2, c: 3, g: [1, 2, 3] }
142
+ * ])
143
+ * ```
144
+ *
107
145
  * See also:
146
+ * * [pipe](/docs/pipe)
147
+ * * [compose](/docs/compose)
108
148
  * * [callProp](/docs/callProp)
109
149
  * * [differenceWith](/docs/differenceWith)
110
150
  *
111
151
  */
112
- const defaultsDeep = defaultCollection => function defaulting(value) {
113
- if (isArray(value) && isArray(defaultCollection)) {
114
- return arrayDefaultsDeepFromArray(value, defaultCollection)
115
- }
116
- if (value == null || defaultCollection == null) {
117
- return value
152
+ function defaultsDeep(...args) {
153
+ if (args.length == 1) {
154
+ return curry2(_defaultsDeep, __, args[0])
118
155
  }
119
- if (value.constructor == Object && defaultCollection.constructor == Object) {
120
- return objectDefaultsDeepFromObject(value, defaultCollection)
156
+ if (args.length == 2) {
157
+ return _defaultsDeep(...args)
121
158
  }
122
- return value
159
+ throw new TypeError('Invalid number of arguments')
123
160
  }
124
161
 
125
162
  module.exports = defaultsDeep
@@ -2,6 +2,29 @@ const assert = require('assert')
2
2
  const defaultsDeep = require('./defaultsDeep')
3
3
 
4
4
  describe('defaultsDeep', () => {
5
+ it('eager API', async () => {
6
+ assert.deepEqual(
7
+ defaultsDeep([3], [1, 2, 3]),
8
+ [3, 2, 3],
9
+ )
10
+ assert.deepEqual(
11
+ defaultsDeep([[]], [[1], 2, 3]),
12
+ [[1], 2, 3],
13
+ )
14
+ })
15
+
16
+ it('Invalid number of arguments', async () => {
17
+ assert.throws(
18
+ () => defaultsDeep(),
19
+ new TypeError('Invalid number of arguments'),
20
+ )
21
+
22
+ assert.throws(
23
+ () => defaultsDeep(1, 2, 3),
24
+ new TypeError('Invalid number of arguments'),
25
+ )
26
+ })
27
+
5
28
  it('default array', async () => {
6
29
  assert.deepEqual(
7
30
  defaultsDeep([1, 2, 3])([3]),
@@ -97,7 +120,7 @@ describe('defaultsDeep', () => {
97
120
  { obj: { a: '1' } },
98
121
  )
99
122
  })
100
- it('nullish default item should use current item', async () => {
123
+ it('nullish default element should use current element', async () => {
101
124
  assert.deepEqual(
102
125
  defaultsDeep([null, 1, 2, 3, 4])([0, 1, 2]),
103
126
  [0, 1, 2, 3, 4],
@@ -32,13 +32,13 @@ const differenceWithArrayAsync = async function (
32
32
  ) {
33
33
  const allValuesLength = allValues.length
34
34
  while (++index < allValuesLength) {
35
- const item = allValues[index]
36
- let doesItemExistByComparator = arraySome(array, curry2(comparator, item, __))
37
- if (isPromise(doesItemExistByComparator)) {
38
- doesItemExistByComparator = await doesItemExistByComparator
35
+ const element = allValues[index]
36
+ let doesElementExistByComparator = arraySome(array, curry2(comparator, element, __))
37
+ if (isPromise(doesElementExistByComparator)) {
38
+ doesElementExistByComparator = await doesElementExistByComparator
39
39
  }
40
- if (!doesItemExistByComparator) {
41
- result.push(item)
40
+ if (!doesElementExistByComparator) {
41
+ result.push(element)
42
42
  }
43
43
  }
44
44
  return result
@@ -61,14 +61,14 @@ const differenceWithArray = function (comparator, allValues, array) {
61
61
  result = []
62
62
  let index = -1
63
63
  while (++index < allValuesLength) {
64
- const item = allValues[index],
65
- doesItemExistByComparator = arraySome(array, curry2(comparator, item, __))
66
- if (isPromise(doesItemExistByComparator)) {
67
- return doesItemExistByComparator.then(funcConcatSync(
68
- curry3(thunkConditional, __, noop, thunkify2(arrayPush, result, item)),
64
+ const element = allValues[index],
65
+ doesElementExistByComparator = arraySome(array, curry2(comparator, element, __))
66
+ if (isPromise(doesElementExistByComparator)) {
67
+ return doesElementExistByComparator.then(funcConcatSync(
68
+ curry3(thunkConditional, __, noop, thunkify2(arrayPush, result, element)),
69
69
  thunkify5(differenceWithArrayAsync, comparator, allValues, array, result, index)))
70
- } else if (!doesItemExistByComparator) {
71
- result.push(item)
70
+ } else if (!doesElementExistByComparator) {
71
+ result.push(element)
72
72
  }
73
73
  }
74
74
  return result
package/x/find.d.ts CHANGED
@@ -15,7 +15,7 @@ export = find;
15
15
  * ```
16
16
  *
17
17
  * @description
18
- * Get the first item in a foldable collection that matches a predicate.
18
+ * Get the first element in a foldable collection that matches a predicate.
19
19
  *
20
20
  * ```javascript [playground]
21
21
  * import find from 'https://unpkg.com/rubico/dist/x/find.es.js'
package/x/find.js CHANGED
@@ -22,7 +22,7 @@ const asyncIteratorFind = require('../_internal/asyncIteratorFind')
22
22
  * ```
23
23
  *
24
24
  * @description
25
- * Get the first item in a foldable collection that matches a predicate.
25
+ * Get the first element in a foldable collection that matches a predicate.
26
26
  *
27
27
  * ```javascript [playground]
28
28
  * import find from 'https://unpkg.com/rubico/dist/x/find.es.js'
package/x/find.test.js CHANGED
@@ -2,7 +2,7 @@ const assert = require('assert')
2
2
  const find = require('./find')
3
3
 
4
4
  describe('find', () => {
5
- it('gets the first item that passes test', async () => {
5
+ it('gets the first element that passes test', async () => {
6
6
  assert.strictEqual(
7
7
  find(x => x > 2)([1, 2, 3]),
8
8
  3,
@@ -33,7 +33,7 @@ describe('find', () => {
33
33
  )
34
34
  })
35
35
 
36
- it('returns undefined for no items passing', async () => {
36
+ it('returns undefined for no elements passing', async () => {
37
37
  assert.strictEqual(
38
38
  find(x => x > 3)([1, 2, 3]),
39
39
  undefined,
@@ -2,7 +2,7 @@ const assert = require('assert')
2
2
  const findIndex = require('./findIndex')
3
3
 
4
4
  describe('findIndex', function () {
5
- it('finds the index in an array of the first item matching a predicate function', async function () {
5
+ it('finds the index in an array of the first element matching a predicate function', async function () {
6
6
  const startsWithAAA = string => string.startsWith('AAA')
7
7
  {
8
8
  const foundIndex = findIndex(startsWithAAA)([
package/x/first.d.ts CHANGED
@@ -10,7 +10,7 @@ export = first;
10
10
  * ```
11
11
  *
12
12
  * @description
13
- * Get the first item of a collection
13
+ * Get the first element of a collection
14
14
  *
15
15
  * ```javascript [playground]
16
16
  * import first from 'https://unpkg.com/rubico/dist/x/first.es.js'
package/x/first.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * ```
10
10
  *
11
11
  * @description
12
- * Get the first item of a collection
12
+ * Get the first element of a collection
13
13
  *
14
14
  * ```javascript [playground]
15
15
  * import first from 'https://unpkg.com/rubico/dist/x/first.es.js'
package/x/first.test.js CHANGED
@@ -2,7 +2,7 @@ const assert = require('assert')
2
2
  const first = require('./first')
3
3
 
4
4
  describe('first', () => {
5
- it('gets the first item of an array', async () => {
5
+ it('gets the first element of an array', async () => {
6
6
  assert.strictEqual(first([1, 2, 3]), 1)
7
7
  assert.strictEqual(first([]), undefined)
8
8
  })
package/x/groupBy.d.ts CHANGED
@@ -35,7 +35,7 @@ export = groupBy;
35
35
  * // }
36
36
  * ```
37
37
  *
38
- * Additionally, pass a resolver in property position to resolve a value for group membership for each item.
38
+ * Additionally, pass a resolver in property position to resolve a value for group membership for each element.
39
39
  *
40
40
  * ```javascript [playground]
41
41
  * import groupBy from 'https://unpkg.com/rubico/dist/x/groupBy.es.js'
package/x/groupBy.js CHANGED
@@ -4,33 +4,33 @@ const reduce = require('../reduce')
4
4
  const __ = require('../_internal/placeholder')
5
5
  const curry3 = require('../_internal/curry3')
6
6
 
7
- // (mapOfArrays Map<any=>Array>, key any, item any) => mapOfArrays
7
+ // (mapOfArrays Map<any=>Array>, key any, element any) => mapOfArrays
8
8
  // TODO: benchmark vs mapOfArrays.has(key)
9
- const group = function (mapOfArrays, key, item) {
9
+ const group = function (mapOfArrays, key, element) {
10
10
  const array = mapOfArrays.get(key)
11
11
  if (array == null) {
12
- mapOfArrays.set(key, [item])
12
+ mapOfArrays.set(key, [element])
13
13
  } else {
14
- array.push(item)
14
+ array.push(element)
15
15
  }
16
16
  return mapOfArrays
17
17
  }
18
18
 
19
- // property string => (mapOfArrays Map<any=>Array>, item any) => mapOfArrays
19
+ // property string => (mapOfArrays Map<any=>Array>, element any) => mapOfArrays
20
20
  const groupByProperty = property => function groupByPropertyReducer(
21
- mapOfArrays, item,
21
+ mapOfArrays, element,
22
22
  ) {
23
- return group(mapOfArrays, item[property], item)
23
+ return group(mapOfArrays, element[property], element)
24
24
  }
25
25
 
26
- // resolver any=>any => (mapOfArrays Map<any=>Array>, item any) => mapOfArrays
26
+ // resolver any=>any => (mapOfArrays Map<any=>Array>, element any) => mapOfArrays
27
27
  const groupByResolver = resolver => function groupByResolverReducer(
28
- mapOfArrays, item,
28
+ mapOfArrays, element,
29
29
  ) {
30
- const key = resolver(item)
30
+ const key = resolver(element)
31
31
  return isPromise(key)
32
- ? key.then(curry3(group, mapOfArrays, __, item))
33
- : group(mapOfArrays, key, item)
32
+ ? key.then(curry3(group, mapOfArrays, __, element))
33
+ : group(mapOfArrays, key, element)
34
34
  }
35
35
 
36
36
 
@@ -70,7 +70,7 @@ const groupByResolver = resolver => function groupByResolverReducer(
70
70
  * // }
71
71
  * ```
72
72
  *
73
- * Additionally, pass a resolver in property position to resolve a value for group membership for each item.
73
+ * Additionally, pass a resolver in property position to resolve a value for group membership for each element.
74
74
  *
75
75
  * ```javascript [playground]
76
76
  * import groupBy from 'https://unpkg.com/rubico/dist/x/groupBy.es.js'
package/x/last.d.ts CHANGED
@@ -10,7 +10,7 @@ export = last;
10
10
  * ```
11
11
  *
12
12
  * @description
13
- * Get the last item of a collection
13
+ * Get the last element of a collection
14
14
  *
15
15
  * ```javascript [playground]
16
16
  * import last from 'https://unpkg.com/rubico/dist/x/last.es.js'
package/x/last.js CHANGED
@@ -9,7 +9,7 @@
9
9
  * ```
10
10
  *
11
11
  * @description
12
- * Get the last item of a collection
12
+ * Get the last element of a collection
13
13
  *
14
14
  * ```javascript [playground]
15
15
  * import last from 'https://unpkg.com/rubico/dist/x/last.es.js'
package/x/last.test.js CHANGED
@@ -2,7 +2,7 @@ const assert = require('assert')
2
2
  const last = require('./last')
3
3
 
4
4
  describe('last', () => {
5
- it('gets the last item of an array', async () => {
5
+ it('gets the last element of an array', async () => {
6
6
  assert.strictEqual(last([1, 2, 3]), 3)
7
7
  assert.strictEqual(last([]), undefined)
8
8
  })
package/x/maxBy.d.ts CHANGED
@@ -4,22 +4,22 @@ export = maxBy;
4
4
  *
5
5
  * @synopsis
6
6
  * ```coffeescript [specscript]
7
- * maxBy(array Array, path string) -> maxItemByPath any
7
+ * maxBy(array Array, path string) -> maxElementByPath any
8
8
  *
9
- * maxBy(path string)(array Array) -> maxItemByPath any
9
+ * maxBy(path string)(array Array) -> maxElementByPath any
10
10
  * ```
11
11
  *
12
12
  * @description
13
- * Finds the item that is the max by a property denoted by path.
13
+ * Finds the element that is the max by a property denoted by path.
14
14
  *
15
15
  * ```javascript [playground]
16
16
  * import maxBy from 'https://unpkg.com/rubico/dist/x/maxBy.es.js'
17
17
  *
18
18
  * const array = [{ a: 1 }, { a: 2 }, { a: 3 }]
19
19
  *
20
- * const maxItem = maxBy(array, 'a')
20
+ * const maxElement = maxBy(array, 'a')
21
21
  *
22
- * console.log(maxItem) // { a: 3 }
22
+ * console.log(maxElement) // { a: 3 }
23
23
  * ```
24
24
  *
25
25
  * `maxBy` composes in a lazy way.
@@ -29,13 +29,13 @@ export = maxBy;
29
29
  *
30
30
  * const numbers = [1, 2, 3]
31
31
  *
32
- * const maxItem = pipe(numbers, [
32
+ * const maxElement = pipe(numbers, [
33
33
  * map(number => number ** 2),
34
34
  * map(number => ({ a: { b: { c: number } } })),
35
35
  * maxBy('a.b.c')
36
36
  * ])
37
37
  *
38
- * console.log(maxItem) // { a: { b: { c: 9 } } }
38
+ * console.log(maxElement) // { a: { b: { c: 9 } } }
39
39
  * ```
40
40
  */
41
41
  declare function maxBy(...args: any[]): any;
package/x/maxBy.js CHANGED
@@ -7,21 +7,21 @@ const curry2 = require('../_internal/curry2')
7
7
  *
8
8
  * @synopsis
9
9
  * ```coffeescript [specscript]
10
- * _maxBy(array Array, path string) -> maxItemByPath any
10
+ * _maxBy(array Array, path string) -> maxElementByPath any
11
11
  * ```
12
12
  */
13
13
  const _maxBy = function (array, path) {
14
14
  const length = array.length
15
15
  const getter = get(path)
16
16
  let index = 0
17
- let maxItem = array[index]
17
+ let maxElement = array[index]
18
18
  while (++index < length) {
19
- const item = array[index]
20
- if (getter(item) > getter(maxItem)) {
21
- maxItem = item
19
+ const element = array[index]
20
+ if (getter(element) > getter(maxElement)) {
21
+ maxElement = element
22
22
  }
23
23
  }
24
- return maxItem
24
+ return maxElement
25
25
  }
26
26
 
27
27
  /**
@@ -29,22 +29,22 @@ const _maxBy = function (array, path) {
29
29
  *
30
30
  * @synopsis
31
31
  * ```coffeescript [specscript]
32
- * maxBy(array Array, path string) -> maxItemByPath any
32
+ * maxBy(array Array, path string) -> maxElementByPath any
33
33
  *
34
- * maxBy(path string)(array Array) -> maxItemByPath any
34
+ * maxBy(path string)(array Array) -> maxElementByPath any
35
35
  * ```
36
36
  *
37
37
  * @description
38
- * Finds the item that is the max by a property denoted by path.
38
+ * Finds the element that is the max by a property denoted by path.
39
39
  *
40
40
  * ```javascript [playground]
41
41
  * import maxBy from 'https://unpkg.com/rubico/dist/x/maxBy.es.js'
42
42
  *
43
43
  * const array = [{ a: 1 }, { a: 2 }, { a: 3 }]
44
44
  *
45
- * const maxItem = maxBy(array, 'a')
45
+ * const maxElement = maxBy(array, 'a')
46
46
  *
47
- * console.log(maxItem) // { a: 3 }
47
+ * console.log(maxElement) // { a: 3 }
48
48
  * ```
49
49
  *
50
50
  * `maxBy` composes in a lazy way.
@@ -54,13 +54,13 @@ const _maxBy = function (array, path) {
54
54
  *
55
55
  * const numbers = [1, 2, 3]
56
56
  *
57
- * const maxItem = pipe(numbers, [
57
+ * const maxElement = pipe(numbers, [
58
58
  * map(number => number ** 2),
59
59
  * map(number => ({ a: { b: { c: number } } })),
60
60
  * maxBy('a.b.c')
61
61
  * ])
62
62
  *
63
- * console.log(maxItem) // { a: { b: { c: 9 } } }
63
+ * console.log(maxElement) // { a: { b: { c: 9 } } }
64
64
  * ```
65
65
  */
66
66
  const maxBy = function (...args) {
package/x/maxBy.test.js CHANGED
@@ -4,20 +4,20 @@ const pipe = require('../pipe')
4
4
  const map = require('../map')
5
5
 
6
6
  describe('maxBy', () => {
7
- it('Finds the item that is the max by a property denoted by path', async () => {
7
+ it('Finds the element that is the max by a property denoted by path', async () => {
8
8
  const array = [{ a: 1 }, { a: 2 }, { a: 3 }]
9
- const maxItem = maxBy(array, 'a')
10
- assert.deepEqual(maxItem, { a: 3 })
9
+ const maxElement = maxBy(array, 'a')
10
+ assert.deepEqual(maxElement, { a: 3 })
11
11
  })
12
12
 
13
13
  it('composes in a lazy way', async () => {
14
14
  const numbers = [1, 2, 3]
15
- const maxItem = pipe(numbers, [
15
+ const maxElement = pipe(numbers, [
16
16
  map(number => number ** 2),
17
17
  map(number => ({ a: { b: { c: number } } })),
18
18
  maxBy('a.b.c'),
19
19
  ])
20
- assert.deepEqual(maxItem, { a: { b: { c: 9 } } })
20
+ assert.deepEqual(maxElement, { a: { b: { c: 9 } } })
21
21
  })
22
22
 
23
23
  it('returns undefined for empty array', async () => {
package/x/pluck.test.js CHANGED
@@ -4,7 +4,7 @@ const pluck = require('./pluck')
4
4
  const createAbc = v => ({ a: { b: { c: v } } })
5
5
 
6
6
  describe('pluck', () => {
7
- it('creates a new collection by getting a path from every item of an old collection', async () => {
7
+ it('creates a new collection by getting a path from every element of an old collection', async () => {
8
8
  const nested = [1, 2, 3].map(createAbc)
9
9
  assert.deepEqual(
10
10
  pluck('a.b.c')(nested),
package/x/prepend.d.ts CHANGED
@@ -5,7 +5,7 @@ export = prepend;
5
5
  * @synopsis
6
6
  * ```coffeescript [specscript]
7
7
  * prepend(
8
- * item string|Array,
8
+ * element string|Array,
9
9
  * )(value string|Array) -> string|array
10
10
  * ```
11
11
  *
@@ -35,4 +35,4 @@ export = prepend;
35
35
  *
36
36
  * @since 1.7.3
37
37
  */
38
- declare function prepend(item: any): (value: any) => string | any[];
38
+ declare function prepend(element: any): (value: any) => string | any[];