rubico 2.8.5 → 2.8.6

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 (369) hide show
  1. package/README.md +1 -0
  2. package/_internal/curryArity.js +3 -3
  3. package/all.js +28 -53
  4. package/and.js +1 -1
  5. package/assign.js +14 -16
  6. package/compose.js +12 -13
  7. package/curry.js +1 -1
  8. package/dist/Transducer.es.js +1 -1
  9. package/dist/Transducer.es.min.js +1 -1
  10. package/dist/Transducer.js +1 -1
  11. package/dist/Transducer.min.js +1 -1
  12. package/dist/Transducer.mjs +1 -1
  13. package/dist/__.es.js +1 -1
  14. package/dist/__.es.min.js +1 -1
  15. package/dist/__.js +1 -1
  16. package/dist/__.min.js +1 -1
  17. package/dist/__.mjs +1 -1
  18. package/dist/all.es.js +1 -1
  19. package/dist/all.es.min.js +1 -1
  20. package/dist/all.js +1 -1
  21. package/dist/all.min.js +1 -1
  22. package/dist/all.mjs +1 -1
  23. package/dist/always.es.js +1 -1
  24. package/dist/always.es.min.js +1 -1
  25. package/dist/always.js +1 -1
  26. package/dist/always.min.js +1 -1
  27. package/dist/always.mjs +1 -1
  28. package/dist/and.es.js +1 -1
  29. package/dist/and.es.min.js +1 -1
  30. package/dist/and.js +1 -1
  31. package/dist/and.min.js +1 -1
  32. package/dist/and.mjs +1 -1
  33. package/dist/assign.es.js +1 -1
  34. package/dist/assign.es.min.js +1 -1
  35. package/dist/assign.js +1 -1
  36. package/dist/assign.min.js +1 -1
  37. package/dist/assign.mjs +1 -1
  38. package/dist/compose.es.js +1 -1
  39. package/dist/compose.es.min.js +1 -1
  40. package/dist/compose.js +1 -1
  41. package/dist/compose.min.js +1 -1
  42. package/dist/compose.mjs +1 -1
  43. package/dist/curry.es.js +4 -4
  44. package/dist/curry.es.min.js +2 -2
  45. package/dist/curry.js +4 -4
  46. package/dist/curry.min.js +2 -2
  47. package/dist/curry.mjs +4 -4
  48. package/dist/eq.es.js +1 -1
  49. package/dist/eq.es.min.js +1 -1
  50. package/dist/eq.js +1 -1
  51. package/dist/eq.min.js +1 -1
  52. package/dist/eq.mjs +1 -1
  53. package/dist/every.es.js +1 -1
  54. package/dist/every.es.min.js +1 -1
  55. package/dist/every.js +1 -1
  56. package/dist/every.min.js +1 -1
  57. package/dist/every.mjs +1 -1
  58. package/dist/filter.es.js +1 -1
  59. package/dist/filter.es.min.js +1 -1
  60. package/dist/filter.js +1 -1
  61. package/dist/filter.min.js +1 -1
  62. package/dist/filter.mjs +1 -1
  63. package/dist/flatMap.es.js +1 -1
  64. package/dist/flatMap.es.min.js +1 -1
  65. package/dist/flatMap.js +1 -1
  66. package/dist/flatMap.min.js +1 -1
  67. package/dist/flatMap.mjs +1 -1
  68. package/dist/forEach.es.js +1 -1
  69. package/dist/forEach.es.min.js +1 -1
  70. package/dist/forEach.js +1 -1
  71. package/dist/forEach.min.js +1 -1
  72. package/dist/forEach.mjs +1 -1
  73. package/dist/get.es.js +27 -3
  74. package/dist/get.es.min.js +2 -2
  75. package/dist/get.js +27 -3
  76. package/dist/get.min.js +2 -2
  77. package/dist/get.mjs +27 -3
  78. package/dist/gt.es.js +1 -1
  79. package/dist/gt.es.min.js +1 -1
  80. package/dist/gt.js +1 -1
  81. package/dist/gt.min.js +1 -1
  82. package/dist/gt.mjs +1 -1
  83. package/dist/gte.es.js +1 -1
  84. package/dist/gte.es.min.js +1 -1
  85. package/dist/gte.js +1 -1
  86. package/dist/gte.min.js +1 -1
  87. package/dist/gte.mjs +1 -1
  88. package/dist/lt.es.js +1 -1
  89. package/dist/lt.es.min.js +1 -1
  90. package/dist/lt.js +1 -1
  91. package/dist/lt.min.js +1 -1
  92. package/dist/lt.mjs +1 -1
  93. package/dist/lte.es.js +1 -1
  94. package/dist/lte.es.min.js +1 -1
  95. package/dist/lte.js +1 -1
  96. package/dist/lte.min.js +1 -1
  97. package/dist/lte.mjs +1 -1
  98. package/dist/map.es.js +4 -4
  99. package/dist/map.es.min.js +2 -2
  100. package/dist/map.js +4 -4
  101. package/dist/map.min.js +2 -2
  102. package/dist/map.mjs +4 -4
  103. package/dist/not.es.js +1 -1
  104. package/dist/not.es.min.js +1 -1
  105. package/dist/not.js +1 -1
  106. package/dist/not.min.js +1 -1
  107. package/dist/not.mjs +1 -1
  108. package/dist/omit.es.js +1 -1
  109. package/dist/omit.es.min.js +1 -1
  110. package/dist/omit.js +1 -1
  111. package/dist/omit.min.js +1 -1
  112. package/dist/omit.mjs +1 -1
  113. package/dist/or.es.js +1 -1
  114. package/dist/or.es.min.js +1 -1
  115. package/dist/or.js +1 -1
  116. package/dist/or.min.js +1 -1
  117. package/dist/or.mjs +1 -1
  118. package/dist/pick.es.js +1 -1
  119. package/dist/pick.es.min.js +1 -1
  120. package/dist/pick.js +1 -1
  121. package/dist/pick.min.js +1 -1
  122. package/dist/pick.mjs +1 -1
  123. package/dist/pipe.es.js +1 -1
  124. package/dist/pipe.es.min.js +1 -1
  125. package/dist/pipe.js +1 -1
  126. package/dist/pipe.min.js +1 -1
  127. package/dist/pipe.mjs +1 -1
  128. package/dist/reduce.es.js +1 -1
  129. package/dist/reduce.es.min.js +1 -1
  130. package/dist/reduce.js +1 -1
  131. package/dist/reduce.min.js +1 -1
  132. package/dist/reduce.mjs +1 -1
  133. package/dist/rubico.es.js +6 -6
  134. package/dist/rubico.es.min.js +2 -2
  135. package/dist/rubico.global.js +6 -6
  136. package/dist/rubico.global.min.js +2 -2
  137. package/dist/rubico.js +6 -6
  138. package/dist/rubico.min.js +2 -2
  139. package/dist/rubico.mjs +6 -6
  140. package/dist/set.es.js +1 -1
  141. package/dist/set.es.min.js +1 -1
  142. package/dist/set.js +1 -1
  143. package/dist/set.min.js +1 -1
  144. package/dist/set.mjs +1 -1
  145. package/dist/some.es.js +1 -1
  146. package/dist/some.es.min.js +1 -1
  147. package/dist/some.js +1 -1
  148. package/dist/some.min.js +1 -1
  149. package/dist/some.mjs +1 -1
  150. package/dist/switchCase.es.js +1 -1
  151. package/dist/switchCase.es.min.js +1 -1
  152. package/dist/switchCase.js +1 -1
  153. package/dist/switchCase.min.js +1 -1
  154. package/dist/switchCase.mjs +1 -1
  155. package/dist/tap.es.js +1 -1
  156. package/dist/tap.es.min.js +1 -1
  157. package/dist/tap.js +1 -1
  158. package/dist/tap.min.js +1 -1
  159. package/dist/tap.mjs +1 -1
  160. package/dist/thunkify.es.js +1 -1
  161. package/dist/thunkify.es.min.js +1 -1
  162. package/dist/thunkify.js +1 -1
  163. package/dist/thunkify.min.js +1 -1
  164. package/dist/thunkify.mjs +1 -1
  165. package/dist/transform.es.js +1 -1
  166. package/dist/transform.es.min.js +1 -1
  167. package/dist/transform.js +1 -1
  168. package/dist/transform.min.js +1 -1
  169. package/dist/transform.mjs +1 -1
  170. package/dist/tryCatch.es.js +1 -1
  171. package/dist/tryCatch.es.min.js +1 -1
  172. package/dist/tryCatch.js +1 -1
  173. package/dist/tryCatch.min.js +1 -1
  174. package/dist/tryCatch.mjs +1 -1
  175. package/dist/x/append.es.js +1 -1
  176. package/dist/x/append.es.min.js +1 -1
  177. package/dist/x/append.js +1 -1
  178. package/dist/x/append.min.js +1 -1
  179. package/dist/x/append.mjs +1 -1
  180. package/dist/x/callProp.es.js +1 -1
  181. package/dist/x/callProp.es.min.js +1 -1
  182. package/dist/x/callProp.js +1 -1
  183. package/dist/x/callProp.min.js +1 -1
  184. package/dist/x/callProp.mjs +1 -1
  185. package/dist/x/defaultsDeep.es.js +1 -1
  186. package/dist/x/defaultsDeep.es.min.js +1 -1
  187. package/dist/x/defaultsDeep.js +1 -1
  188. package/dist/x/defaultsDeep.min.js +1 -1
  189. package/dist/x/defaultsDeep.mjs +1 -1
  190. package/dist/x/differenceWith.es.js +1 -1
  191. package/dist/x/differenceWith.es.min.js +1 -1
  192. package/dist/x/differenceWith.js +1 -1
  193. package/dist/x/differenceWith.min.js +1 -1
  194. package/dist/x/differenceWith.mjs +1 -1
  195. package/dist/x/filterOut.es.js +1 -1
  196. package/dist/x/filterOut.es.min.js +1 -1
  197. package/dist/x/filterOut.js +1 -1
  198. package/dist/x/filterOut.min.js +1 -1
  199. package/dist/x/filterOut.mjs +1 -1
  200. package/dist/x/find.es.js +1 -1
  201. package/dist/x/find.es.min.js +1 -1
  202. package/dist/x/find.js +1 -1
  203. package/dist/x/find.min.js +1 -1
  204. package/dist/x/find.mjs +1 -1
  205. package/dist/x/findIndex.es.js +1 -1
  206. package/dist/x/findIndex.es.min.js +1 -1
  207. package/dist/x/findIndex.js +1 -1
  208. package/dist/x/findIndex.min.js +1 -1
  209. package/dist/x/findIndex.mjs +1 -1
  210. package/dist/x/first.es.js +1 -1
  211. package/dist/x/first.es.min.js +1 -1
  212. package/dist/x/first.js +1 -1
  213. package/dist/x/first.min.js +1 -1
  214. package/dist/x/first.mjs +1 -1
  215. package/dist/x/flatten.es.js +1 -1
  216. package/dist/x/flatten.es.min.js +1 -1
  217. package/dist/x/flatten.js +1 -1
  218. package/dist/x/flatten.min.js +1 -1
  219. package/dist/x/flatten.mjs +1 -1
  220. package/dist/x/groupBy.es.js +1 -1
  221. package/dist/x/groupBy.es.min.js +1 -1
  222. package/dist/x/groupBy.js +1 -1
  223. package/dist/x/groupBy.min.js +1 -1
  224. package/dist/x/groupBy.mjs +1 -1
  225. package/dist/x/has.es.js +1 -1
  226. package/dist/x/has.es.min.js +1 -1
  227. package/dist/x/has.js +1 -1
  228. package/dist/x/has.min.js +1 -1
  229. package/dist/x/has.mjs +1 -1
  230. package/dist/x/identity.es.js +1 -1
  231. package/dist/x/identity.es.min.js +1 -1
  232. package/dist/x/identity.js +1 -1
  233. package/dist/x/identity.min.js +1 -1
  234. package/dist/x/identity.mjs +1 -1
  235. package/dist/x/includes.es.js +1 -1
  236. package/dist/x/includes.es.min.js +1 -1
  237. package/dist/x/includes.js +1 -1
  238. package/dist/x/includes.min.js +1 -1
  239. package/dist/x/includes.mjs +1 -1
  240. package/dist/x/isDeepEqual.es.js +1 -1
  241. package/dist/x/isDeepEqual.es.min.js +1 -1
  242. package/dist/x/isDeepEqual.js +1 -1
  243. package/dist/x/isDeepEqual.min.js +1 -1
  244. package/dist/x/isDeepEqual.mjs +1 -1
  245. package/dist/x/isEmpty.es.js +1 -1
  246. package/dist/x/isEmpty.es.min.js +1 -1
  247. package/dist/x/isEmpty.js +1 -1
  248. package/dist/x/isEmpty.min.js +1 -1
  249. package/dist/x/isEmpty.mjs +1 -1
  250. package/dist/x/isEqual.es.js +1 -1
  251. package/dist/x/isEqual.es.min.js +1 -1
  252. package/dist/x/isEqual.js +1 -1
  253. package/dist/x/isEqual.min.js +1 -1
  254. package/dist/x/isEqual.mjs +1 -1
  255. package/dist/x/isFunction.es.js +1 -1
  256. package/dist/x/isFunction.es.min.js +1 -1
  257. package/dist/x/isFunction.js +1 -1
  258. package/dist/x/isFunction.min.js +1 -1
  259. package/dist/x/isFunction.mjs +1 -1
  260. package/dist/x/isIn.es.js +1 -1
  261. package/dist/x/isIn.es.min.js +1 -1
  262. package/dist/x/isIn.js +1 -1
  263. package/dist/x/isIn.min.js +1 -1
  264. package/dist/x/isIn.mjs +1 -1
  265. package/dist/x/isObject.es.js +1 -1
  266. package/dist/x/isObject.es.min.js +1 -1
  267. package/dist/x/isObject.js +1 -1
  268. package/dist/x/isObject.min.js +1 -1
  269. package/dist/x/isObject.mjs +1 -1
  270. package/dist/x/isString.es.js +1 -1
  271. package/dist/x/isString.es.min.js +1 -1
  272. package/dist/x/isString.js +1 -1
  273. package/dist/x/isString.min.js +1 -1
  274. package/dist/x/isString.mjs +1 -1
  275. package/dist/x/keys.es.js +1 -1
  276. package/dist/x/keys.es.min.js +1 -1
  277. package/dist/x/keys.js +1 -1
  278. package/dist/x/keys.min.js +1 -1
  279. package/dist/x/keys.mjs +1 -1
  280. package/dist/x/last.es.js +1 -1
  281. package/dist/x/last.es.min.js +1 -1
  282. package/dist/x/last.js +1 -1
  283. package/dist/x/last.min.js +1 -1
  284. package/dist/x/last.mjs +1 -1
  285. package/dist/x/maxBy.es.js +27 -23
  286. package/dist/x/maxBy.es.min.js +2 -2
  287. package/dist/x/maxBy.js +27 -23
  288. package/dist/x/maxBy.min.js +2 -2
  289. package/dist/x/maxBy.mjs +27 -23
  290. package/dist/x/noop.es.js +1 -1
  291. package/dist/x/noop.es.min.js +1 -1
  292. package/dist/x/noop.js +1 -1
  293. package/dist/x/noop.min.js +1 -1
  294. package/dist/x/noop.mjs +1 -1
  295. package/dist/x/pluck.es.js +8 -6
  296. package/dist/x/pluck.es.min.js +2 -2
  297. package/dist/x/pluck.js +8 -6
  298. package/dist/x/pluck.min.js +2 -2
  299. package/dist/x/pluck.mjs +8 -6
  300. package/dist/x/prepend.es.js +1 -1
  301. package/dist/x/prepend.es.min.js +1 -1
  302. package/dist/x/prepend.js +1 -1
  303. package/dist/x/prepend.min.js +1 -1
  304. package/dist/x/prepend.mjs +1 -1
  305. package/dist/x/size.es.js +1 -1
  306. package/dist/x/size.es.min.js +1 -1
  307. package/dist/x/size.js +1 -1
  308. package/dist/x/size.min.js +1 -1
  309. package/dist/x/size.mjs +1 -1
  310. package/dist/x/trace.es.js +1 -1
  311. package/dist/x/trace.es.min.js +1 -1
  312. package/dist/x/trace.js +1 -1
  313. package/dist/x/trace.min.js +1 -1
  314. package/dist/x/trace.mjs +1 -1
  315. package/dist/x/unionWith.es.js +1 -1
  316. package/dist/x/unionWith.es.min.js +1 -1
  317. package/dist/x/unionWith.js +1 -1
  318. package/dist/x/unionWith.min.js +1 -1
  319. package/dist/x/unionWith.mjs +1 -1
  320. package/dist/x/uniq.es.js +1 -1
  321. package/dist/x/uniq.es.min.js +1 -1
  322. package/dist/x/uniq.js +1 -1
  323. package/dist/x/uniq.min.js +1 -1
  324. package/dist/x/uniq.mjs +1 -1
  325. package/dist/x/unless.es.js +1 -1
  326. package/dist/x/unless.es.min.js +1 -1
  327. package/dist/x/unless.js +1 -1
  328. package/dist/x/unless.min.js +1 -1
  329. package/dist/x/unless.mjs +1 -1
  330. package/dist/x/values.es.js +1 -1
  331. package/dist/x/values.es.min.js +1 -1
  332. package/dist/x/values.js +1 -1
  333. package/dist/x/values.min.js +1 -1
  334. package/dist/x/values.mjs +1 -1
  335. package/dist/x/when.es.js +1 -1
  336. package/dist/x/when.es.min.js +1 -1
  337. package/dist/x/when.js +1 -1
  338. package/dist/x/when.min.js +1 -1
  339. package/dist/x/when.mjs +1 -1
  340. package/eq.js +1 -1
  341. package/es.js +6 -6
  342. package/every.js +1 -1
  343. package/filter.js +1 -1
  344. package/flatMap.js +1 -1
  345. package/forEach.js +2 -2
  346. package/get.js +46 -24
  347. package/gt.js +1 -1
  348. package/gte.js +1 -1
  349. package/index.js +6 -6
  350. package/lt.js +1 -1
  351. package/lte.js +1 -1
  352. package/map.js +4 -4
  353. package/monad/Mux.js +6 -4
  354. package/monad/PossiblePromise.js +6 -4
  355. package/monad/README.md +60 -39
  356. package/monad/Struct.js +6 -4
  357. package/not.js +1 -1
  358. package/omit.js +1 -1
  359. package/or.js +1 -1
  360. package/package.json +1 -1
  361. package/pick.js +1 -1
  362. package/pipe.js +18 -24
  363. package/reduce.js +1 -1
  364. package/set.js +1 -1
  365. package/some.js +1 -1
  366. package/switchCase.js +41 -41
  367. package/tap.js +13 -21
  368. package/transform.js +1 -1
  369. package/tryCatch.js +16 -24
package/switchCase.js CHANGED
@@ -12,84 +12,84 @@ const curryArgs3 = require('./_internal/curryArgs3')
12
12
  *
13
13
  * @synopsis
14
14
  * ```coffeescript [specscript]
15
- * args Array<any>
16
- * argsOrPromises Array<Promise|any>
15
+ * type SyncOrAsyncPredicate = (...arguments)=>Promise|boolean|any
16
+ * type SyncOrAsyncFunction = (...arguments)=>Promise|any
17
17
  *
18
- * type SyncOrAsyncPredicate = (...args)=>Promise|boolean|any
18
+ * conditionalValues Array<Promise|boolean|any>
19
+ * conditionalFunctionsOrValues Array<SyncOrAsyncPredicate|SyncOrAsyncFunction|Promise|boolean|any>
19
20
  *
20
- * conditionalPromisesOrValues Array<Promise|boolean|any>
21
- * conditionalFuncsOrPromisesOrValues Array<SyncOrAsyncPredicate|Promise|boolean|any>
22
- *
23
- * switchCase(conditionalPromisesOrValues) -> Promise|any
24
- * switchCase(...argsOrPromises, conditionalFuncsOrPromisesOrValues) -> Promise|any
25
- * switchCase(conditionalFuncsOrPromisesOrValues)(...args) -> Promise|any
21
+ * switchCase(conditionalValues) -> Promise|any
22
+ * switchCase(...arguments, conditionalFunctionsOrValues) -> Promise|any
23
+ * switchCase(conditionalFunctionsOrValues)(...arguments) -> Promise|any
26
24
  * ```
27
25
  *
28
26
  * @description
29
- * Function equivalent to the [Conditional (ternary) operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator). Accepts an array of conditional functions that specifies cases as pairings of `predicate` and `resolver` functions with the exception of the last, default resolver. All functions are provided with the same arguments and executed in series. The result of a `switchCase` operation is either the result of the execution the last default resolver, or the result of the execution of the first resolver where the associated predicate tested true.
27
+ * Conditional function operator. Accepts an array of conditional functions or values that specifies cases as function or value pairs with the exception of the last, default function or value. All functions are provided with the same arguments and executed in series. The result of a conditional execution with `switchCase` is the result of the execution of the first truthy function or value pair, the result of the execution of the last, default function, or the provided last, default value.
30
28
  *
31
29
  * ```javascript [playground]
32
- * const fruitIsYellow = fruit => fruit.color == 'yellow'
33
- *
34
- * console.log(
35
- * switchCase({ name: 'plantain', color: 'yellow' }, [
36
- * fruitIsYellow,
37
- * fruit => fruit.name + ' is possibly a banana',
38
- * fruit => fruit.name + ' is probably not a banana',
39
- * ])
40
- * ) // plantain is possibly a banana
30
+ * function isOdd(n) {
31
+ * return n % 2 == 1
32
+ * }
33
+ *
34
+ * switchCase(1, [
35
+ * isOdd,
36
+ * n => console.log(`${n} is odd`),
37
+ * n => console.log(`${n} is even`),
38
+ * ])
41
39
  * ```
42
40
  *
43
- * For composability `switchCase` supports a lazy API.
41
+ * `switchCase` supports a lazy API for composability.
44
42
  *
45
43
  * ```javascript [playground]
46
- * const fruitIsYellow = fruit => fruit.color == 'yellow'
47
- *
48
44
  * const fruitsGuesser = switchCase([
49
- * fruitIsYellow,
45
+ * fruit => fruit.color == 'yellow',
50
46
  * fruit => fruit.name + ' is possibly a banana',
51
47
  * fruit => fruit.name + ' is probably not a banana',
52
48
  * ])
53
49
  *
54
- * console.log(fruitsGuesser({ name: 'plantain', color: 'yellow' }))
55
- * // plantain is possibly a banana
50
+ * const guess1 = fruitsGuesser({ name: 'plantain', color: 'yellow' })
51
+ * const guess2 = fruitsGuesser({ name: 'apple', color: 'red' })
56
52
  *
57
- * console.log(fruitsGuesser({ name: 'apple', color: 'red' }))
58
- * // apple is probably not a banana
53
+ * console.log(guess1)
54
+ * console.log(guess2)
59
55
  * ```
60
56
  *
61
- * Any function can be replaced with a nonfunction (object or primitive) value to be used directly in the operation.
57
+ * Any item of the conditional array passed to switchCase can be a nonfunction (object or primitive) value.
62
58
  *
63
59
  * ```javascript [playground]
64
- * switchCase(false, [
65
- * async function asyncIdentity(value) {
66
- * return value
67
- * },
68
- * 'something',
69
- * 'default',
70
- * ]).then(console.log) // default
60
+ * function identity (value) {
61
+ * return value
62
+ * }
63
+ *
64
+ * const value = switchCase(false, [
65
+ * identity,
66
+ * 'non-function',
67
+ * 'default-value',
68
+ * ])
69
+ *
70
+ * console.log(value)
71
71
  * ```
72
72
  *
73
- * If every element in the conditional array is a nonfunction value, `switchCase` executes eagerly.
73
+ * If every item in the conditional array is a nonfunction value, `switchCase` executes eagerly.
74
74
  *
75
75
  * ```javascript [playground]
76
76
  * const age = 26
77
77
  *
78
- * const myDrink = switchCase([age >= 21, 'Beer', 'Juice'])
78
+ * const myDrink = switchCase([age >= 21, 'Water', 'Juice'])
79
79
  *
80
- * console.log(myDrink) // Beer
80
+ * console.log(myDrink)
81
81
  * ```
82
82
  *
83
- * Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
83
+ * Any promises passed in argument position are resolved for their values before further execution.
84
84
  *
85
85
  * ```javascript [playground]
86
86
  * switchCase(Promise.resolve(1), 2, Promise.resolve(3), [
87
87
  * function doValuesAddUpTo6(a, b, c) {
88
- * return a + b + c == 6
88
+ * return a + b + c === 6
89
89
  * },
90
90
  * (a, b, c) => console.log(`${a} + ${b} + ${c} == 6`),
91
91
  * (a, b, c) => console.log(`${a} + ${b} + ${c} != 6`),
92
- * ]) // 1 + 2 + 3 == 6
92
+ * ])
93
93
  * ```
94
94
  *
95
95
  * See also:
package/tap.js CHANGED
@@ -22,15 +22,12 @@ const _tap = function (args, f) {
22
22
  *
23
23
  * @synopsis
24
24
  * ```coffeescript [specscript]
25
- * args Array<any>
26
- * argsOrPromises Array<Promise|any>
27
- *
28
- * type SyncOrAsyncFunction = (...args)=>Promise|any
25
+ * type SyncOrAsyncFunction = (...arguments)=>Promise|any
29
26
  *
30
27
  * f SyncOrAsyncFunction
31
28
  *
32
- * tap(...argsOrPromises, f) -> Promise|args[0]
33
- * tap(f)(...args) -> Promise|args[0]
29
+ * tap(...arguments, f) -> Promise|arguments[0]
30
+ * tap(f)(...arguments) -> Promise|arguments[0]
34
31
  * ```
35
32
  *
36
33
  * @description
@@ -43,15 +40,13 @@ const _tap = function (args, f) {
43
40
  * tap(value => console.log(value + 'barbaz')),
44
41
  * ])
45
42
  *
46
- * pipeline('foo') // 'foo'
47
- * // 'foobar'
48
- * // 'foobarbaz'
43
+ * pipeline('foo')
49
44
  * ```
50
45
  *
51
- * Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
46
+ * Any promises passed in argument position are resolved for their values before further execution.
52
47
  *
53
48
  * ```javascript [playground]
54
- * tap(Promise.resolve(1), Promise.resolve(2), 3, console.log) // 1 2 3
49
+ * tap(Promise.resolve(1), Promise.resolve(2), 3, console.log)
55
50
  * ```
56
51
  *
57
52
  * See also:
@@ -108,17 +103,14 @@ const _tapIf = function (predicate, f, args) {
108
103
  *
109
104
  * @synopsis
110
105
  * ```coffeescript [specscript]
111
- * args Array<any>
112
- * argsOrPromises Array<Promise|any>
113
- *
114
- * type SyncOrAsyncPredicate = (...args)=>Promise|boolean|any
115
- * type SyncOrAsyncFunction = (...args)=>Promise|any
106
+ * type SyncOrAsyncPredicate = (...arguments)=>Promise|boolean|any
107
+ * type SyncOrAsyncFunction = (...arguments)=>Promise|any
116
108
  *
117
109
  * predicate SyncOrAsyncPredicate
118
110
  * f SyncOrAsyncFunction
119
111
  *
120
- * tap.if(...argsOrPromises, predicate, f) -> Promise|args[0]
121
- * tap.if(predicate, f)(...args) -> Promise|args[0]
112
+ * tap.if(...arguments, predicate, f) -> Promise|arguments[0]
113
+ * tap.if(predicate, f)(...arguments) -> Promise|arguments[0]
122
114
  * ```
123
115
  *
124
116
  * @description
@@ -130,13 +122,13 @@ const _tapIf = function (predicate, f, args) {
130
122
  * const logIfOdd = tap.if(isOdd, console.log)
131
123
  *
132
124
  * logIfOdd(2)
133
- * logIfOdd(3) // 3
125
+ * logIfOdd(3)
134
126
  * ```
135
127
  *
136
- * Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
128
+ * Any promises passed in argument position are resolved for their values before further execution.
137
129
  *
138
130
  * ```javascript [playground]
139
- * tap.if(Promise.resolve(1), n => n < 5, console.log) // 1
131
+ * tap.if(Promise.resolve(1), n => n < 5, console.log)
140
132
  * tap.if(Promise.resolve(6), n => n < 5, console.log)
141
133
  * ```
142
134
  *
package/transform.js CHANGED
@@ -201,7 +201,7 @@ const _transform = function (collection, transducer, initialValue) {
201
201
  * promise.then(console.log)
202
202
  * ```
203
203
  *
204
- * Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
204
+ * Any promises passed in argument position are resolved for their values before further execution.
205
205
  *
206
206
  * ```javascript [playground]
207
207
  * const promise = transform(
package/tryCatch.js CHANGED
@@ -22,28 +22,25 @@ const _tryCatch = function (tryer, catcher, args) {
22
22
  *
23
23
  * @synopsis
24
24
  * ```coffeescript [specscript]
25
- * args Array<any>
26
- * argsOrPromises Array<Promise|any>
27
- *
28
- * type SyncOrAsyncFunction = (...args)=>Promise|any
29
- * type SyncOrAsyncCatcher = (error Error|any, ...args)=>Promise|any
25
+ * type SyncOrAsyncFunction = (...arguments)=>Promise|any
26
+ * type SyncOrAsyncCatcher = (error Error|any, ...arguments)=>Promise|any
30
27
  *
31
28
  * tryer SyncOrAsyncFunction
32
29
  * catcher SyncOrAsyncCatcher
33
30
  *
34
- * tryCatch(tryer, catcher)(...args) -> Promise|any
35
- * tryCatch(...argsOrPromises, tryer, catcher) -> Promise|any
31
+ * tryCatch(tryer, catcher)(...arguments) -> Promise|any
32
+ * tryCatch(...arguments, tryer, catcher) -> Promise|any
36
33
  * ```
37
34
  *
38
35
  * @description
39
- * Function equivalent to the [try...catch](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch) statement. Accepts two functions: a `tryer` function and a `catcher` function. Calls the `tryer` function and catches any errors thrown by the `tryer` function with the `catcher` function.
36
+ * Function error handler. Accepts a tryer function and a catcher function. Calls the tryer function and catches any error thrown by the tryer function with the catcher function.
40
37
  *
41
38
  * ```javascript [playground]
42
39
  * const throwsIfOdd = number => {
43
- * if (number % 2 == 1) {
40
+ * if (number % 2 === 1) {
44
41
  * throw new Error(`${number} is odd`)
45
42
  * }
46
- * console.log('did not throw for', number)
43
+ * console.log('did not throw for number', number)
47
44
  * }
48
45
  *
49
46
  * const errorHandler = (error, number) => {
@@ -53,20 +50,18 @@ const _tryCatch = function (tryer, catcher, args) {
53
50
  *
54
51
  * const handler = tryCatch(throwsIfOdd, errorHandler)
55
52
  *
56
- * handler(2) // did not throw for 2
57
- * handler(3) // caught error from number 3
58
- * // Error: 3 is odd
59
- *
53
+ * handler(2)
54
+ * handler(3)
60
55
  * ```
61
56
  *
62
- * If the `tryer` function is asynchronous and throws an error, the `catcher` function will catch the rejected promise.
57
+ * If the tryer function is asynchronous and returns a rejected promise, the catcher function will handle the error from the rejected promise.
63
58
  *
64
59
  * ```javascript [playground]
65
60
  * const rejectsIfOdd = async number => {
66
61
  * if (number % 2 == 1) {
67
62
  * throw new Error(`${number} is odd`)
68
63
  * }
69
- * console.log('did not throw for', number)
64
+ * console.log('did not reject for number', number)
70
65
  * }
71
66
  *
72
67
  * const errorHandler = (error, number) => {
@@ -76,13 +71,11 @@ const _tryCatch = function (tryer, catcher, args) {
76
71
  *
77
72
  * const asyncHandler = tryCatch(rejectsIfOdd, errorHandler)
78
73
  *
79
- * asyncHandler(2) // did not throw for 2
80
- * asyncHandler(3) // caught error from number 3
81
- * // Error: 3 is odd
82
- *
74
+ * asyncHandler(2)
75
+ * asyncHandler(3)
83
76
  * ```
84
77
  *
85
- * When provided any number of arguments before the tryer and catcher functions, `tryCatch` executes immediately.
78
+ * `tryCatch` executes eagerly when provided any number of arguments before the tryer and catcher functions.
86
79
  *
87
80
  * ```javascript [playground]
88
81
  * const add = (a, b) => a + b
@@ -91,11 +84,11 @@ const _tryCatch = function (tryer, catcher, args) {
91
84
  * const sum = numbers.reduce(add)
92
85
  * throw new Error(`the sum is ${sum}`)
93
86
  * }, function logErrorMessage(error) {
94
- * console.error(error.message) // the sum is 6
87
+ * console.error(error.message)
95
88
  * })
96
89
  * ```
97
90
  *
98
- * Any promises passed in argument position are resolved for their values before further execution. This only applies to the eager version of the API.
91
+ * Any promises passed in argument position are resolved for their values before further execution.
99
92
  *
100
93
  * ```javascript [playground]
101
94
  * tryCatch(Promise.resolve(1), 2, Promise.resolve(3), (a, b, c) => {
@@ -103,7 +96,6 @@ const _tryCatch = function (tryer, catcher, args) {
103
96
  * if (sum > 5) {
104
97
  * throw new Error('limit exceeded')
105
98
  * }
106
- * console.log('sum:', sum)
107
99
  * }, (error, a, b, c) => {
108
100
  * console.error(`${a} + ${b} + ${c}: ${error.message}`)
109
101
  * })