ramda-adjunct 5.0.0 → 5.0.1

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 (406) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +1 -1
  3. package/dist/RA.node.js +10444 -452
  4. package/dist/RA.node.min.js +1 -1
  5. package/dist/RA.web.js +10444 -452
  6. package/dist/RA.web.min.js +1 -1
  7. package/dist/RA.web.standalone.js +18665 -447
  8. package/dist/RA.web.standalone.min.js +1 -1
  9. package/dist/package.json +1 -0
  10. package/es/copyKeys.js +1 -1
  11. package/es/dispatch.js +5 -5
  12. package/es/fantasy-land/Identity.js +3 -3
  13. package/es/fantasy-land/traits.js +1 -1
  14. package/es/flattenDepth.js +5 -5
  15. package/es/internal/ponyfills/Array.from.js +5 -5
  16. package/es/internal/ponyfills/Promise.allSettled.js +5 -5
  17. package/es/internal/ponyfills/Promise.any.js +15 -15
  18. package/es/lastP.js +5 -5
  19. package/es/reduceP.js +4 -4
  20. package/es/reduceRightP.js +4 -4
  21. package/es/renameKey.js +1 -1
  22. package/es/sortByProps.js +5 -5
  23. package/lib/allEqual.js +1 -1
  24. package/lib/allIdentical.js +1 -1
  25. package/lib/allSettledP.js +1 -1
  26. package/lib/allUnique.js +1 -1
  27. package/lib/anyP.js +1 -1
  28. package/lib/argsPass.js +1 -1
  29. package/lib/async.js +1 -1
  30. package/lib/cata.js +1 -1
  31. package/lib/compact.js +1 -1
  32. package/lib/concatAll.js +1 -1
  33. package/lib/copyKeys.js +2 -2
  34. package/lib/curryRight.js +1 -1
  35. package/lib/delayP.js +1 -1
  36. package/lib/dispatch.js +6 -6
  37. package/lib/ensureArray.js +1 -1
  38. package/lib/escapeRegExp.js +1 -1
  39. package/lib/fantasy-land/Identity.js +3 -3
  40. package/lib/fantasy-land/traits.js +2 -2
  41. package/lib/flattenDepth.js +6 -6
  42. package/lib/flattenProp.js +1 -1
  43. package/lib/fnull.js +1 -1
  44. package/lib/index.js +1 -1
  45. package/lib/internal/ap.js +1 -1
  46. package/lib/internal/isCoercible.js +1 -1
  47. package/lib/internal/makeFlat.js +1 -1
  48. package/lib/internal/ponyfills/Array.from.js +6 -6
  49. package/lib/internal/ponyfills/Math.trunc.js +1 -1
  50. package/lib/internal/ponyfills/Number.isFinite.js +1 -1
  51. package/lib/internal/ponyfills/Number.isInteger.js +1 -1
  52. package/lib/internal/ponyfills/Number.isNaN.js +1 -1
  53. package/lib/internal/ponyfills/Number.isSafeInteger.js +1 -1
  54. package/lib/internal/ponyfills/Promise.allSettled.js +6 -6
  55. package/lib/internal/ponyfills/Promise.any.js +16 -16
  56. package/lib/internal/ponyfills/String.padEnd.js +1 -1
  57. package/lib/internal/ponyfills/String.padStart.js +1 -1
  58. package/lib/internal/ponyfills/String.repeat.js +1 -1
  59. package/lib/internal/ponyfills/String.replaceAll.js +1 -1
  60. package/lib/invoke.js +1 -1
  61. package/lib/invokeArgs.js +1 -1
  62. package/lib/isArray.js +1 -1
  63. package/lib/isArrayLike.js +1 -1
  64. package/lib/isBlank.js +1 -1
  65. package/lib/isEmptyArray.js +1 -1
  66. package/lib/isEven.js +1 -1
  67. package/lib/isFalsy.js +1 -1
  68. package/lib/isFinite.js +1 -1
  69. package/lib/isFloat.js +1 -1
  70. package/lib/isFunction.js +1 -1
  71. package/lib/isIndexed.js +1 -1
  72. package/lib/isInteger.js +1 -1
  73. package/lib/isInteger32.js +1 -1
  74. package/lib/isIterable.js +1 -1
  75. package/lib/isNaN.js +1 -1
  76. package/lib/isNaturalNumber.js +1 -1
  77. package/lib/isNegative.js +1 -1
  78. package/lib/isNonEmptyArray.js +1 -1
  79. package/lib/isNonEmptyString.js +1 -1
  80. package/lib/isNonNegative.js +1 -1
  81. package/lib/isNonPositive.js +1 -1
  82. package/lib/isNotArray.js +1 -1
  83. package/lib/isNotArrayLike.js +1 -1
  84. package/lib/isNotAsyncFunction.js +1 -1
  85. package/lib/isNotBoolean.js +1 -1
  86. package/lib/isNotDate.js +1 -1
  87. package/lib/isNotFinite.js +1 -1
  88. package/lib/isNotFloat.js +1 -1
  89. package/lib/isNotFunction.js +1 -1
  90. package/lib/isNotGeneratorFunction.js +1 -1
  91. package/lib/isNotInteger.js +1 -1
  92. package/lib/isNotMap.js +1 -1
  93. package/lib/isNotNaN.js +1 -1
  94. package/lib/isNotNilOrEmpty.js +1 -1
  95. package/lib/isNotNull.js +1 -1
  96. package/lib/isNotNumber.js +1 -1
  97. package/lib/isNotObj.js +1 -1
  98. package/lib/isNotObjLike.js +1 -1
  99. package/lib/isNotPair.js +1 -1
  100. package/lib/isNotPlainObj.js +1 -1
  101. package/lib/isNotPrimitive.js +1 -1
  102. package/lib/isNotRegExp.js +1 -1
  103. package/lib/isNotSet.js +1 -1
  104. package/lib/isNotString.js +1 -1
  105. package/lib/isNotUndefined.js +1 -1
  106. package/lib/isNotValidDate.js +1 -1
  107. package/lib/isNotValidNumber.js +1 -1
  108. package/lib/isObj.js +1 -1
  109. package/lib/isObjLike.js +1 -1
  110. package/lib/isOdd.js +1 -1
  111. package/lib/isPair.js +1 -1
  112. package/lib/isPlainObj.js +1 -1
  113. package/lib/isPositive.js +1 -1
  114. package/lib/isPrimitive.js +1 -1
  115. package/lib/isPromise.js +1 -1
  116. package/lib/isPrototypeOf.js +1 -1
  117. package/lib/isSafeInteger.js +1 -1
  118. package/lib/isSentinelValue.js +1 -1
  119. package/lib/isSparseArray.js +1 -1
  120. package/lib/isThenable.js +1 -1
  121. package/lib/isUinteger32.js +1 -1
  122. package/lib/isUndefined.js +1 -1
  123. package/lib/isValidDate.js +1 -1
  124. package/lib/isValidNumber.js +1 -1
  125. package/lib/lastP.js +6 -6
  126. package/lib/lengthEq.js +1 -1
  127. package/lib/lengthGt.js +1 -1
  128. package/lib/lengthGte.js +1 -1
  129. package/lib/lengthLt.js +1 -1
  130. package/lib/lengthLte.js +1 -1
  131. package/lib/lengthNotEq.js +1 -1
  132. package/lib/lensNotEq.js +1 -1
  133. package/lib/lensNotSatisfy.js +1 -1
  134. package/lib/lensSatisfies.js +1 -1
  135. package/lib/lensTraverse.js +1 -1
  136. package/lib/liftF.js +1 -1
  137. package/lib/liftFN.js +1 -1
  138. package/lib/mergePaths.js +1 -1
  139. package/lib/mergeProp.js +1 -1
  140. package/lib/noneP.js +1 -1
  141. package/lib/noop.js +1 -1
  142. package/lib/notAllUnique.js +1 -1
  143. package/lib/padCharsEnd.js +1 -1
  144. package/lib/padCharsStart.js +1 -1
  145. package/lib/padEnd.js +1 -1
  146. package/lib/padStart.js +1 -1
  147. package/lib/rangeStep.js +1 -1
  148. package/lib/reduceP.js +5 -5
  149. package/lib/reduceRightP.js +5 -5
  150. package/lib/renameKey.js +2 -2
  151. package/lib/renameKeyWith.js +1 -1
  152. package/lib/renameKeys.js +1 -1
  153. package/lib/repeatStr.js +1 -1
  154. package/lib/replaceAll.js +1 -1
  155. package/lib/sign.js +1 -1
  156. package/lib/sortByProp.js +1 -1
  157. package/lib/sortByProps.js +5 -5
  158. package/lib/spreadProp.js +1 -1
  159. package/lib/toArray.js +1 -1
  160. package/lib/toNumber.js +1 -1
  161. package/lib/trimCharsEnd.js +1 -1
  162. package/lib/trimCharsStart.js +1 -1
  163. package/lib/trimEnd.js +1 -1
  164. package/lib/trimStart.js +1 -1
  165. package/lib/trunc.js +1 -1
  166. package/lib/unzipObjWith.js +1 -1
  167. package/package.json +22 -19
  168. package/babel.config.cjs +0 -56
  169. package/src/Y.js +0 -32
  170. package/src/allEqual.js +0 -28
  171. package/src/allEqualTo.js +0 -25
  172. package/src/allIdentical.js +0 -26
  173. package/src/allIdenticalTo.js +0 -25
  174. package/src/allP.js +0 -27
  175. package/src/allSettledP.js +0 -34
  176. package/src/allUnique.js +0 -25
  177. package/src/anyP.js +0 -33
  178. package/src/appendFlipped.js +0 -24
  179. package/src/argsPass.js +0 -40
  180. package/src/async.js +0 -60
  181. package/src/cata.js +0 -86
  182. package/src/catchP.js +0 -25
  183. package/src/ceil.js +0 -28
  184. package/src/compact.js +0 -23
  185. package/src/concatAll.js +0 -35
  186. package/src/concatRight.js +0 -30
  187. package/src/copyKeys.js +0 -31
  188. package/src/curryRight.js +0 -26
  189. package/src/curryRightN.js +0 -29
  190. package/src/defaultWhen.js +0 -26
  191. package/src/delayP.js +0 -45
  192. package/src/dispatch.js +0 -74
  193. package/src/divideNum.js +0 -20
  194. package/src/dropArgs.js +0 -23
  195. package/src/ensureArray.js +0 -24
  196. package/src/escapeRegExp.js +0 -22
  197. package/src/fantasy-land/Identity.js +0 -270
  198. package/src/fantasy-land/mapping.js +0 -20
  199. package/src/fantasy-land/traits.js +0 -57
  200. package/src/fantasy-land/util.js +0 -23
  201. package/src/filterIndexed.js +0 -28
  202. package/src/findOr.js +0 -30
  203. package/src/flattenDepth.js +0 -39
  204. package/src/flattenPath.js +0 -28
  205. package/src/flattenProp.js +0 -28
  206. package/src/floor.js +0 -27
  207. package/src/fnull.js +0 -38
  208. package/src/inRange.js +0 -34
  209. package/src/included.js +0 -28
  210. package/src/index.js +0 -241
  211. package/src/internal/ap.js +0 -30
  212. package/src/internal/compareLength.js +0 -7
  213. package/src/internal/isCoercible.js +0 -12
  214. package/src/internal/isOfTypeObject.js +0 -3
  215. package/src/internal/makeFlat.js +0 -42
  216. package/src/internal/ponyfills/Array.from.js +0 -34
  217. package/src/internal/ponyfills/Math.sign.js +0 -3
  218. package/src/internal/ponyfills/Math.trunc.js +0 -14
  219. package/src/internal/ponyfills/Number.MAX_SAFE_INTEGER.js +0 -3
  220. package/src/internal/ponyfills/Number.MIN_SAFE_INTEGER.js +0 -3
  221. package/src/internal/ponyfills/Number.isFinite.js +0 -8
  222. package/src/internal/ponyfills/Number.isInteger.js +0 -10
  223. package/src/internal/ponyfills/Number.isNaN.js +0 -8
  224. package/src/internal/ponyfills/Number.isSafeInteger.js +0 -11
  225. package/src/internal/ponyfills/Promise.allSettled.js +0 -18
  226. package/src/internal/ponyfills/Promise.any.js +0 -29
  227. package/src/internal/ponyfills/String.padEnd.js +0 -25
  228. package/src/internal/ponyfills/String.padStart.js +0 -27
  229. package/src/internal/ponyfills/String.repeat.js +0 -49
  230. package/src/internal/ponyfills/String.replaceAll.js +0 -44
  231. package/src/internal/ponyfills/String.trimEnd.js +0 -5
  232. package/src/internal/ponyfills/String.trimStart.js +0 -5
  233. package/src/invoke.js +0 -22
  234. package/src/invokeArgs.js +0 -36
  235. package/src/isArray.js +0 -27
  236. package/src/isArrayLike.js +0 -79
  237. package/src/isAsyncFunction.js +0 -23
  238. package/src/isBigInt.js +0 -24
  239. package/src/isBlank.js +0 -33
  240. package/src/isBoolean.js +0 -22
  241. package/src/isDate.js +0 -21
  242. package/src/isEmptyArray.js +0 -28
  243. package/src/isEmptyString.js +0 -28
  244. package/src/isError.js +0 -21
  245. package/src/isEven.js +0 -31
  246. package/src/isFalse.js +0 -31
  247. package/src/isFalsy.js +0 -28
  248. package/src/isFinite.js +0 -37
  249. package/src/isFloat.js +0 -36
  250. package/src/isFunction.js +0 -32
  251. package/src/isGeneratorFunction.js +0 -26
  252. package/src/isIndexed.js +0 -24
  253. package/src/isInteger.js +0 -40
  254. package/src/isInteger32.js +0 -28
  255. package/src/isIterable.js +0 -37
  256. package/src/isMap.js +0 -25
  257. package/src/isNaN.js +0 -45
  258. package/src/isNaturalNumber.js +0 -28
  259. package/src/isNegative.js +0 -27
  260. package/src/isNegativeZero.js +0 -23
  261. package/src/isNilOrEmpty.js +0 -26
  262. package/src/isNonEmptyArray.js +0 -28
  263. package/src/isNonEmptyString.js +0 -31
  264. package/src/isNonNegative.js +0 -30
  265. package/src/isNonPositive.js +0 -30
  266. package/src/isNotArray.js +0 -24
  267. package/src/isNotArrayLike.js +0 -26
  268. package/src/isNotAsyncFunction.js +0 -27
  269. package/src/isNotBoolean.js +0 -24
  270. package/src/isNotDate.js +0 -23
  271. package/src/isNotFinite.js +0 -31
  272. package/src/isNotFloat.js +0 -35
  273. package/src/isNotFunction.js +0 -29
  274. package/src/isNotGeneratorFunction.js +0 -27
  275. package/src/isNotInteger.js +0 -36
  276. package/src/isNotMap.js +0 -27
  277. package/src/isNotNaN.js +0 -37
  278. package/src/isNotNil.js +0 -23
  279. package/src/isNotNilOrEmpty.js +0 -28
  280. package/src/isNotNull.js +0 -24
  281. package/src/isNotNumber.js +0 -25
  282. package/src/isNotObj.js +0 -29
  283. package/src/isNotObjLike.js +0 -29
  284. package/src/isNotPair.js +0 -27
  285. package/src/isNotPlainObj.js +0 -35
  286. package/src/isNotPrimitive.js +0 -26
  287. package/src/isNotRegExp.js +0 -24
  288. package/src/isNotSet.js +0 -26
  289. package/src/isNotString.js +0 -23
  290. package/src/isNotUndefined.js +0 -24
  291. package/src/isNotValidDate.js +0 -24
  292. package/src/isNotValidNumber.js +0 -27
  293. package/src/isNull.js +0 -22
  294. package/src/isNumber.js +0 -24
  295. package/src/isObj.js +0 -31
  296. package/src/isObjLike.js +0 -30
  297. package/src/isOdd.js +0 -29
  298. package/src/isPair.js +0 -27
  299. package/src/isPlainObj.js +0 -65
  300. package/src/isPositive.js +0 -26
  301. package/src/isPositiveZero.js +0 -23
  302. package/src/isPrimitive.js +0 -46
  303. package/src/isPromise.js +0 -32
  304. package/src/isPrototypeOf.js +0 -36
  305. package/src/isRegExp.js +0 -22
  306. package/src/isSafeInteger.js +0 -40
  307. package/src/isSentinelValue.js +0 -26
  308. package/src/isSet.js +0 -24
  309. package/src/isSparseArray.js +0 -43
  310. package/src/isString.js +0 -21
  311. package/src/isSymbol.js +0 -29
  312. package/src/isThenable.js +0 -28
  313. package/src/isTrue.js +0 -27
  314. package/src/isTruthy.js +0 -28
  315. package/src/isUinteger32.js +0 -29
  316. package/src/isUndefined.js +0 -24
  317. package/src/isValidDate.js +0 -29
  318. package/src/isValidNumber.js +0 -28
  319. package/src/lastP.js +0 -54
  320. package/src/lengthEq.js +0 -24
  321. package/src/lengthGt.js +0 -24
  322. package/src/lengthGte.js +0 -26
  323. package/src/lengthLt.js +0 -24
  324. package/src/lengthLte.js +0 -25
  325. package/src/lengthNotEq.js +0 -24
  326. package/src/lensEq.js +0 -28
  327. package/src/lensIso.js +0 -51
  328. package/src/lensNotEq.js +0 -28
  329. package/src/lensNotSatisfy.js +0 -30
  330. package/src/lensSatisfies.js +0 -33
  331. package/src/lensTraverse.js +0 -56
  332. package/src/liftF.js +0 -37
  333. package/src/liftFN.js +0 -45
  334. package/src/list.js +0 -20
  335. package/src/mapIndexed.js +0 -27
  336. package/src/mergePath.js +0 -30
  337. package/src/mergePaths.js +0 -29
  338. package/src/mergeProp.js +0 -30
  339. package/src/mergeProps.js +0 -27
  340. package/src/move.js +0 -26
  341. package/src/nand.js +0 -27
  342. package/src/neither.js +0 -38
  343. package/src/noneP.js +0 -35
  344. package/src/nonePass.js +0 -32
  345. package/src/noop.js +0 -21
  346. package/src/nor.js +0 -28
  347. package/src/notAllPass.js +0 -32
  348. package/src/notAllUnique.js +0 -25
  349. package/src/notBoth.js +0 -38
  350. package/src/notEqual.js +0 -31
  351. package/src/omitBy.js +0 -25
  352. package/src/omitIndexes.js +0 -27
  353. package/src/overlaps.js +0 -30
  354. package/src/padCharsEnd.js +0 -37
  355. package/src/padCharsStart.js +0 -35
  356. package/src/padEnd.js +0 -25
  357. package/src/padStart.js +0 -23
  358. package/src/pathNotEq.js +0 -31
  359. package/src/pathOrLazy.js +0 -30
  360. package/src/paths.js +0 -26
  361. package/src/pickIndexes.js +0 -30
  362. package/src/propNotEq.js +0 -30
  363. package/src/rangeStep.js +0 -37
  364. package/src/reduceIndexed.js +0 -31
  365. package/src/reduceP.js +0 -96
  366. package/src/reduceRightP.js +0 -101
  367. package/src/rejectP.js +0 -24
  368. package/src/renameKey.js +0 -33
  369. package/src/renameKeyWith.js +0 -30
  370. package/src/renameKeys.js +0 -40
  371. package/src/renameKeysWith.js +0 -27
  372. package/src/repeatStr.js +0 -30
  373. package/src/replaceAll.js +0 -35
  374. package/src/resolveP.js +0 -28
  375. package/src/round.js +0 -26
  376. package/src/seq.js +0 -38
  377. package/src/sign.js +0 -33
  378. package/src/skipTake.js +0 -33
  379. package/src/sliceFrom.js +0 -23
  380. package/src/sliceTo.js +0 -23
  381. package/src/sortByPaths.js +0 -55
  382. package/src/sortByProp.js +0 -45
  383. package/src/sortByProps.js +0 -31
  384. package/src/spreadPath.js +0 -26
  385. package/src/spreadProp.js +0 -25
  386. package/src/stubArray.js +0 -18
  387. package/src/stubNull.js +0 -19
  388. package/src/stubObj.js +0 -19
  389. package/src/stubString.js +0 -19
  390. package/src/stubUndefined.js +0 -19
  391. package/src/subtractNum.js +0 -20
  392. package/src/thenCatchP.js +0 -27
  393. package/src/toArray.js +0 -32
  394. package/src/toInteger32.js +0 -22
  395. package/src/toNumber.js +0 -24
  396. package/src/toUinteger32.js +0 -26
  397. package/src/trimCharsEnd.js +0 -25
  398. package/src/trimCharsStart.js +0 -25
  399. package/src/trimEnd.js +0 -30
  400. package/src/trimStart.js +0 -29
  401. package/src/trunc.js +0 -33
  402. package/src/unzipObjWith.js +0 -40
  403. package/src/viewOr.js +0 -32
  404. package/src/weave.js +0 -35
  405. package/src/weaveLazy.js +0 -37
  406. package/src/zipObjWith.js +0 -27
package/babel.config.cjs DELETED
@@ -1,56 +0,0 @@
1
- 'use strict';
2
-
3
- module.exports = {
4
- env: {
5
- commonjs: {
6
- presets: [
7
- [
8
- '@babel/preset-env',
9
- {
10
- modules: 'commonjs',
11
- forceAllTransforms: true,
12
- },
13
- ],
14
- ],
15
- plugins: [
16
- [
17
- '@babel/plugin-transform-modules-commonjs',
18
- {
19
- loose: true,
20
- },
21
- ],
22
- ],
23
- },
24
- es: {
25
- presets: [
26
- [
27
- '@babel/preset-env',
28
- {
29
- modules: false,
30
- forceAllTransforms: true,
31
- },
32
- ],
33
- ],
34
- },
35
- coverage: {
36
- presets: [
37
- [
38
- '@babel/preset-env',
39
- {
40
- modules: 'commonjs',
41
- forceAllTransforms: true,
42
- },
43
- ],
44
- ],
45
- plugins: [
46
- 'istanbul',
47
- [
48
- '@babel/plugin-transform-modules-commonjs',
49
- {
50
- loose: true,
51
- },
52
- ],
53
- ],
54
- },
55
- },
56
- };
package/src/Y.js DELETED
@@ -1,32 +0,0 @@
1
- import { curryN } from 'ramda';
2
-
3
- /**
4
- * Y-combinator
5
- *
6
- * The Y combinator is an interesting function which only works with functional languages,
7
- * showing how recursion can still be done even without any variable or function declarations,
8
- * only functions and parameters
9
- *
10
- * @func Y
11
- * @memberOf RA
12
- * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
13
- * @category Function
14
- * @sig (a, ... -> b -> b) -> (a, ... -> b)
15
- * @param {Function} le Recursive function maker
16
- * @return {Function}
17
- * @see {@link http://kestas.kuliukas.com/YCombinatorExplained/|Y combinator explained}
18
- * @example
19
- *
20
- * const makeFact = givenFact => (n) => {
21
- * if (n < 2) { return 1 }
22
- * return n * givenFact(n - 1);
23
- * };
24
- *
25
- * const factorial = RA.Y(makeFact);
26
- *
27
- * factorial(5); //=> 120
28
- */
29
-
30
- const Y = curryN(1, (le) => ((f) => f(f))((g) => le((x) => g(g)(x))));
31
-
32
- export default Y;
package/src/allEqual.js DELETED
@@ -1,28 +0,0 @@
1
- import { pipe, uniq, curryN } from 'ramda';
2
-
3
- import lengthLte from './lengthLte.js';
4
-
5
- // Original idea for this function was conceived by https://github.com/jackmellis
6
- // in https://github.com/char0n/ramda-adjunct/pull/513.
7
-
8
- /**
9
- * Returns true if all items in the list are equivalent using `R.equals` for equality comparisons.
10
- *
11
- * @func allEqual
12
- * @memberOf RA
13
- * @since {@link https://char0n.github.io/ramda-adjunct/2.9.0|v2.9.0}
14
- * @category List
15
- * @sig [a] -> Boolean
16
- * @param {Array} list The list of values
17
- * @return {boolean}
18
- * @see {@link https://ramdajs.com/docs/#equals|equals}
19
- * @example
20
- *
21
- * RA.allEqual([ 1, 2, 3, 4 ]); //=> false
22
- * RA.allEqual([ 1, 1, 1, 1 ]); //=> true
23
- * RA.allEqual([]); //=> true
24
- *
25
- */
26
- const allEqual = curryN(1, pipe(uniq, lengthLte(1)));
27
-
28
- export default allEqual;
package/src/allEqualTo.js DELETED
@@ -1,25 +0,0 @@
1
- import { all, equals, curry } from 'ramda';
2
-
3
- /**
4
- * Returns true if all items in the list are equivalent to user provided value using `R.equals` for equality comparisons.
5
- *
6
- * @func allEqualTo
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
9
- * @category List
10
- * @sig a -> [b] -> Boolean
11
- * @param {*} val User provided value to check the `list` against
12
- * @param {Array} list The list of values
13
- * @return {boolean}
14
- * @see {@link RA.allEqual|allEqual}, {@link https://ramdajs.com/docs/#equals|equals}
15
- * @example
16
- *
17
- * RA.allEqualTo(1, [ 1, 2, 3, 4 ]); //=> false
18
- * RA.allEqualTo(1, [ 1, 1, 1, 1 ]); //=> true
19
- * RA.allEqualTo({}, [ {}, {} ]); //=> true
20
- * RA.allEqualTo(1, []); //=> true
21
- *
22
- */
23
- const allEqualTo = curry((val, list) => all(equals(val), list));
24
-
25
- export default allEqualTo;
@@ -1,26 +0,0 @@
1
- import { uniqWith, identical, pipe, curryN } from 'ramda';
2
-
3
- import lengthLte from './lengthLte.js';
4
-
5
- /**
6
- * Returns true if all items in the list are equivalent using `R.identical` for equality comparisons.
7
- *
8
- * @func allIdentical
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
11
- * @category List
12
- * @sig [a] -> Boolean
13
- * @param {Array} list The list of values
14
- * @return {boolean}
15
- * @see {@link https://ramdajs.com/docs/#identical|identical}
16
- * @example
17
- *
18
- * RA.allIdentical([ 1, 2, 3, 4 ]); //=> false
19
- * RA.allIdentical([ 1, 1, 1, 1 ]); //=> true
20
- * RA.allIdentical([]); //=> true
21
- * RA.allIdentical([ {}, {} ]); //=> false
22
- * RA.allIdentical([ () => {}, () => {} ]); //=> false
23
- */
24
- const allIdentical = curryN(1, pipe(uniqWith(identical), lengthLte(1)));
25
-
26
- export default allIdentical;
@@ -1,25 +0,0 @@
1
- import { curry, identical, all } from 'ramda';
2
-
3
- /**
4
- * Returns true if all items in the list are equivalent to user provided value using `R.identical` for equality comparisons.
5
- *
6
- * @func allIdenticalTo
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/2.11.0|v2.11.0}
9
- * @category List
10
- * @sig a -> [b] -> Boolean
11
- * @param {*} val User provided value to check the `list` against
12
- * @param {Array} list The list of values
13
- * @return {boolean}
14
- * @see {@link RA.allIdentical|allIdentical}, {@link http://ramdajs.com/docs/#identical|R.identical}
15
- * @example
16
- *
17
- * RA.allIdenticalTo(1, [ 1, 2, 3, 4 ]); //=> false
18
- * RA.allIdenticalTo(1, [ 1, 1, 1, 1 ]); //=> true
19
- * RA.allIdenticalTo(1, []); //=> true
20
- * RA.allIdenticalTo({}, [ {}, {} ]); //=> false
21
- *
22
- */
23
- const allIdenticalTo = curry((val, list) => all(identical(val), list));
24
-
25
- export default allIdenticalTo;
package/src/allP.js DELETED
@@ -1,27 +0,0 @@
1
- import { bind, curryN } from 'ramda';
2
-
3
- /**
4
- * Composable shortcut for `Promise.all`.
5
- *
6
- * The `allP` method returns a single Promise that resolves when all of the promises
7
- * in the iterable argument have resolved or when the iterable argument contains no promises.
8
- * It rejects with the reason of the first promise that rejects.
9
- *
10
- * @func allP
11
- * @memberOf RA
12
- * @since {@link https://char0n.github.io/ramda-adjunct/2.3.0|v2.3.0}
13
- * @category Function
14
- * @sig [Promise a] -> Promise [a]
15
- * @param {Iterable.<*>} iterable An iterable object such as an Array or String
16
- * @return {Promise} An already resolved Promise if the iterable passed is empty. An asynchronously resolved Promise if the iterable passed contains no promises. Note, Google Chrome 58 returns an already resolved promise in this case. A pending Promise in all other cases. This returned promise is then resolved/rejected asynchronously (as soon as the stack is empty) when all the promises in the given iterable have resolved, or if any of the promises reject. See the example about "Asynchronicity or synchronicity of allP" below.
17
- * @see {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}
18
- * @example
19
- *
20
- * RA.allP([1, 2]); //=> Promise([1, 2])
21
- * RA.allP([1, Promise.resolve(2)]); //=> Promise([1, 2])
22
- * RA.allP([Promise.resolve(1), Promise.resolve(2)]); //=> Promise([1, 2])
23
- * RA.allP([1, Promise.reject(2)]); //=> Promise(2)
24
- */
25
- const allP = curryN(1, bind(Promise.all, Promise));
26
-
27
- export default allP;
@@ -1,34 +0,0 @@
1
- import { bind, curryN } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
- import ponyfill from './internal/ponyfills/Promise.allSettled.js';
5
-
6
- export const allSettledPPonyfill = curryN(1, ponyfill);
7
-
8
- /**
9
- * Returns a promise that is fulfilled with an array of promise state snapshots,
10
- * but only after all the original promises have settled, i.e. become either fulfilled or rejected.
11
- * We say that a promise is settled if it is not pending, i.e. if it is either fulfilled or rejected.
12
- *
13
- * @func allSettledP
14
- * @memberOf RA
15
- * @since {@link https://char0n.github.io/ramda-adjunct/2.18.0|v2.18.0}
16
- * @category Function
17
- * @typedef Settlement = { status: String, value: * }
18
- * @sig [Promise a] -> Promise [Settlement a]
19
- * @param {Iterable.<*>} iterable An iterable object such as an Array or String
20
- * @return {Promise} Returns a promise that is fulfilled with an array of promise state snapshots
21
- * @see {@link RA.allP|allP}
22
- * @example
23
- *
24
- * RA.allSettledP([
25
- * Promise.resolve(1),
26
- * 2,
27
- * Promise.reject(3),
28
- * ]); //=> Promise([{ status: 'fulfilled', value: 1 }, { status: 'fulfilled', value: 2 }, { status: 'rejected', reason: 3 }])
29
- */
30
- const allSettledP = isFunction(Promise.allSettled)
31
- ? curryN(1, bind(Promise.allSettled, Promise))
32
- : allSettledPPonyfill;
33
-
34
- export default allSettledP;
package/src/allUnique.js DELETED
@@ -1,25 +0,0 @@
1
- import { converge, length, uniq } from 'ramda';
2
-
3
- import lengthEq from './lengthEq.js';
4
-
5
- /**
6
- * Returns true if all items in the list are unique. `R.equals` is used to determine equality.
7
- *
8
- * @func allUnique
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
11
- * @category List
12
- * @sig [a] -> Boolean
13
- * @param {Array} list The list of values
14
- * @return {boolean}
15
- * @see {@link RA.notAllUnique|notAllUnique}, {@link https://ramdajs.com/docs/#equals|equals}
16
- * @example
17
- *
18
- * RA.allUnique([ 1, 2, 3, 4 ]); //=> true
19
- * RA.allUnique([ 1, 1, 2, 3 ]); //=> false
20
- * RA.allUnique([]); //=> true
21
- *
22
- */
23
- const allUnique = converge(lengthEq, [length, uniq]);
24
-
25
- export default allUnique;
package/src/anyP.js DELETED
@@ -1,33 +0,0 @@
1
- import { bind, curryN } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
- import ponyfill, { AggregatedError } from './internal/ponyfills/Promise.any.js';
5
-
6
- export const anyPPonyfill = curryN(1, ponyfill);
7
- export { AggregatedError };
8
-
9
- /**
10
- * Returns a promise that is fulfilled by the first given promise to be fulfilled,
11
- * or rejected with an array of rejection reasons if all of the given promises are rejected.
12
- *
13
- * @func anyP
14
- * @memberOf RA
15
- * @category Function
16
- * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
17
- * @sig [Promise a] -> Promise a
18
- * @param {Iterable.<*>} iterable An iterable object such as an Array or String
19
- * @return {Promise} A promise that is fulfilled by the first given promise to be fulfilled, or rejected with an array of rejection reasons if all of the given promises are rejected
20
- * @see {@link RA.lastP|lastP}
21
- * @example
22
- *
23
- * RA.anyP([
24
- * Promise.resolve(1),
25
- * 2,
26
- * Promise.reject(3),
27
- * ]); //=> Promise(1)
28
- */
29
- const anyP = isFunction(Promise.any)
30
- ? curryN(1, bind(Promise.any, Promise))
31
- : anyPPonyfill;
32
-
33
- export default anyP;
@@ -1,24 +0,0 @@
1
- import { append, flip } from 'ramda';
2
-
3
- /**
4
- * Returns a new list containing the contents of the given list, followed by the given element.
5
- * Like {@link http://ramdajs.com/docs/#append|R.append} but with argument order reversed.
6
- *
7
- * @func appendFlipped
8
- * @memberOf RA
9
- * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
10
- * @category List
11
- * @sig [a] -> a -> [a]
12
- * @param {Array} list The list of elements to add a new item to
13
- * @param {*} el The element to add to the end of the new list
14
- * @return {Array} A new list containing the elements of the old list followed by `el`
15
- * @see {@link http://ramdajs.com/docs/#append|R.append}
16
- * @example
17
- *
18
- * RA.appendFlipped(['write', 'more'], 'tests'); //=> ['write', 'more', 'tests']
19
- * RA.appendFlipped([], 'tests'); //=> ['tests']
20
- * RA.appendFlipped(['write', 'more'], ['tests']); //=> ['write', 'more', ['tests']]
21
- */
22
- const appendFlipped = flip(append);
23
-
24
- export default appendFlipped;
package/src/argsPass.js DELETED
@@ -1,40 +0,0 @@
1
- import { useWith, curry, compose } from 'ramda';
2
-
3
- import list from './list.js';
4
- import isTruthy from './isTruthy.js';
5
-
6
- /**
7
- * Takes a combining predicate and a list of functions and returns a function which will map the
8
- * arguments it receives to the list of functions and returns the result of passing the values
9
- * returned from each function to the combining predicate. A combining predicate is a function that
10
- * combines a list of Boolean values into a single Boolean value, such as `R.any` or `R.all`. It
11
- * will test each value using `RA.isTruthy`, meaning the functions don't necessarily have to be
12
- * predicates.
13
- *
14
- * The function returned is curried to the number of functions supplied, and if called with more
15
- * arguments than functions, any remaining arguments are passed in to the combining predicate
16
- * untouched.
17
- *
18
- * @func argsPass
19
- * @memberOf RA
20
- * @since {@link https://char0n.github.io/ramda-adjunct/2.7.0|v2.7.0}
21
- * @category Logic
22
- * @sig ((* -> Boolean) -> [*] -> Boolean) -> [(* -> Boolean), ...] -> (*...) -> Boolean
23
- * @param {Function} combiningPredicate The predicate used to combine the values returned from the
24
- * list of functions
25
- * @param {Array} functions List of functions
26
- * @return {boolean} Returns the combined result of mapping arguments to functions
27
- * @example
28
- *
29
- * RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 'abc') //=> true
30
- * RA.argsPass(R.all, [RA.isArray, RA.isBoolean, RA.isString])([], false, 1) //=> false
31
- * RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> true
32
- * RA.argsPass(R.any, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> false
33
- * RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, false) //=> true
34
- * RA.argsPass(R.none, [RA.isArray, RA.isBoolean, RA.isString])({}, 1, 'abc') //=> false
35
- */
36
- const argsPass = curry((combiningPredicate, predicates) =>
37
- useWith(compose(combiningPredicate(isTruthy), list), predicates)
38
- );
39
-
40
- export default argsPass;
package/src/async.js DELETED
@@ -1,60 +0,0 @@
1
- import { curryN, bind } from 'ramda';
2
-
3
- import resolveP from './resolveP.js';
4
- import rejectP from './rejectP.js';
5
-
6
- /**
7
- * Takes a generator function and returns an async function.
8
- * The async function returned is a curried function whose arity matches that of the generator function.
9
- *
10
- * Note: This function is handy for environments that does support generators but doesn't support async/await.
11
- *
12
- * @func async
13
- * @memberOf RA
14
- * @since {@link https://char0n.github.io/ramda-adjunct/2.16.0|v2.16.0}
15
- * @category Function
16
- * @sig Promise c => (a, b, ...) -> a -> b -> ... -> c
17
- * @param {Function} generatorFn The generator function
18
- * @return {Function} Curried async function
19
- * @see {@link https://www.promisejs.org/generators/}
20
- * @example
21
- *
22
- * const asyncFn = RA.async(function* generator(val1, val2) {
23
- * const a = yield Promise.resolve(val1);
24
- * const b = yield Promise.resolve(val2);
25
- *
26
- * return a + b;
27
- * });
28
- *
29
- * asyncFn(1, 2); //=> Promise(3)
30
- *
31
- */
32
- const async = curryN(1, (generatorFn) => {
33
- function asyncWrapper(...args) {
34
- const iterator = bind(generatorFn, this)(...args);
35
-
36
- const handle = (result) => {
37
- const resolved = resolveP(result.value);
38
-
39
- return result.done
40
- ? resolved
41
- : resolved.then(
42
- (value) => handle(iterator.next(value)),
43
- (error) => handle(iterator.throw(error))
44
- );
45
- };
46
-
47
- try {
48
- return handle(iterator.next());
49
- } catch (error) {
50
- return rejectP(error);
51
- }
52
- }
53
-
54
- if (generatorFn.length > 0) {
55
- return curryN(generatorFn.length, asyncWrapper);
56
- }
57
- return asyncWrapper;
58
- });
59
-
60
- export default async;
package/src/cata.js DELETED
@@ -1,86 +0,0 @@
1
- import { curry } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
-
5
- /**
6
- * The catamorphism is a way of folding a type into a value.
7
- *
8
- * **Either**
9
- *
10
- * If the either is right then the right function will be executed with
11
- * the `right` value and the value of the function returned. Otherwise the left function
12
- * will be called with the `left` value.
13
- *
14
- * **Maybe**
15
- *
16
- * If the maybe is Some than the right function will be executed with the `some` value and the value of the function
17
- * returned. Otherwise the left function with be called without an argument.
18
- *
19
- * **Result**
20
- *
21
- * If the result is Ok than the right function will be executed with the `Ok` value and the value of the function
22
- * returned. Otherwise the left function will be called with the `Error` value.
23
- *
24
- * **Validation**
25
- *
26
- * If the validation is Success than the right function will be executed with the `Success` value and the value of the function
27
- * returned. Otherwise the left function will be called with the `Failure` value.
28
- *
29
- * Supported monadic libraries: {@link https://monet.github.io/monet.js/|monet.js}, {@link https://folktale.origamitower.com/|folktale}, {@link https://github.com/ramda/ramda-fantasy|ramda-fantasy}
30
- *
31
- * @func cata
32
- * @memberOf RA
33
- * @since {@link https://char0n.github.io/ramda-adjunct/1.4.0|v1.4.0}
34
- * @category Function
35
- * @sig (a -> b) -> (a -> c) -> Cata a -> b | c
36
- * @param {Function} leftFn The left function that consumes the left value
37
- * @param {Function} rightFn The right function that consumes the right value
38
- * @param {Cata} catamorphicObj Either, Maybe or any other type with catamorphic capabilities (`cata` or `either` method)
39
- * @return {*}
40
- * @see {@link https://monet.github.io/monet.js/#cata|cata explained}
41
- * @example
42
- *
43
- * // Either
44
- * const eitherR = Either.Right(1);
45
- * const eitherL = Either.Left(2);
46
- *
47
- * RA.cata(identity, identity, eitherR); //=> 1
48
- * RA.cata(identity, identity, eitherL); //=> 2
49
- *
50
- * // Maybe
51
- * const maybeSome = Maybe.Some(1);
52
- * const maybeNothing = Maybe.Nothing();
53
- *
54
- * RA.cata(identity, identity, maybeSome); //=> 1
55
- * RA.cata(identity, identity, maybeNothing); //=> undefined
56
- */
57
- const catamorphism = curry((leftFn, rightFn, catamorphicObj) => {
58
- // folktale support
59
- if (isFunction(catamorphicObj.matchWith)) {
60
- return catamorphicObj.matchWith({
61
- // Result type
62
- Ok: ({ value }) => rightFn(value),
63
- Error: ({ value }) => leftFn(value),
64
- // Maybe type
65
- Just: ({ value }) => rightFn(value),
66
- Nothing: () => leftFn(undefined),
67
- // Validation type
68
- Success: ({ value }) => rightFn(value),
69
- Failure: ({ value }) => leftFn(value),
70
- });
71
- }
72
-
73
- if (isFunction(catamorphicObj.cata)) {
74
- return catamorphicObj.cata(leftFn, rightFn);
75
- }
76
-
77
- if (isFunction(catamorphicObj.getOrElse)) {
78
- const elseValue = `RA.cata${Math.random()}`;
79
- const value = catamorphicObj.getOrElse(elseValue);
80
- return value === elseValue ? leftFn() : rightFn(value);
81
- }
82
-
83
- return catamorphicObj.either(leftFn, rightFn);
84
- });
85
-
86
- export default catamorphism;
package/src/catchP.js DELETED
@@ -1,25 +0,0 @@
1
- import { invoker } from 'ramda';
2
-
3
- /**
4
- * Composable shortcut for `Promise.catch`.
5
- * The catchP function returns a Promise. It takes two arguments: a callback function for the failure of the Promise
6
- * and the promise instance itself.
7
- *
8
- * @func catchP
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.29.0|v2.29.0}
11
- * @category Function
12
- * @sig (a -> Promise b | b) -> Promise b
13
- * @param {Function} onRejected A Function called if the Promise is rejected. This function has one argument, the rejection reason.
14
- * @param {Promise} promise Any Promise
15
- * @return {Promise} Returns a Promise with dealt rejected cases
16
- * @see {@link RA.thenP|thenP}, {@link RA.resolveP|resolveP}, {@link RA.rejectP|rejectP}, {@link RA.allP|allP}
17
- *
18
- * @example
19
- *
20
- * RA.catchP(() => 'b', Promise.resolve('a')); //=> Promise('a')
21
- * RA.catchP(() => 'b', Promise.reject('a')); //=> Promise('b')
22
- */
23
- const catchP = invoker(1, 'catch');
24
-
25
- export default catchP;
package/src/ceil.js DELETED
@@ -1,28 +0,0 @@
1
- import { bind, curryN } from 'ramda';
2
-
3
- /**
4
- * Returns the smallest integer greater than or equal to a given number.
5
- *
6
- * Note: ceil(null) returns integer 0 and does not give a NaN error.
7
- *
8
- * @func ceil
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.15.0|v2.15.0}
11
- * @category Math
12
- * @sig Number -> Number
13
- * @param {number} number The number to ceil
14
- * @return {number} The smallest integer greater than or equal to the given number
15
- * @example
16
- *
17
- * RA.ceil(.95); //=> 1
18
- * RA.ceil(4); //=> 4
19
- * RA.ceil(7.004); //=> 8
20
- * RA.ceil(-0.95); //=> -0
21
- * RA.ceil(-4); //=> -4
22
- * RA.ceil(-7.004); //=> -7
23
- * RA.ceil(null); //=> 0
24
- */
25
-
26
- const ceil = curryN(1, bind(Math.ceil, Math));
27
-
28
- export default ceil;
package/src/compact.js DELETED
@@ -1,23 +0,0 @@
1
- import { reject } from 'ramda';
2
-
3
- import isFalsy from './isFalsy.js';
4
-
5
- /**
6
- * Creates an array with all falsy values removed.
7
- * The values false, null, 0, "", undefined, and NaN are falsy.
8
- *
9
- * @func compact
10
- * @memberOf RA
11
- * @since {@link https://char0n.github.io/ramda-adjunct/2.5.0|v2.5.0}
12
- * @category List
13
- * @sig Filterable f => f a -> f a
14
- * @param {Array} list The array to compact
15
- * @return {Array} Returns the new array of filtered values
16
- * @see {@link RA.isFalsy|isFalsy}
17
- * @example
18
- *
19
- * RA.compact([0, 1, false, 2, '', 3]); //=> [1, 2, 3]
20
- */
21
- const compact = reject(isFalsy);
22
-
23
- export default compact;
package/src/concatAll.js DELETED
@@ -1,35 +0,0 @@
1
- import { concat, identical, identity, pipe, reduce, when } from 'ramda';
2
-
3
- import stubUndefined from './stubUndefined.js';
4
-
5
- const leftIdentitySemigroup = { concat: identity };
6
-
7
- /**
8
- * Returns the result of concatenating the given lists or strings.
9
- * Note: RA.concatAll expects all elements to be of the same type. It will throw an error if you concat an Array with a non-Array value.
10
- * Dispatches to the concat method of the preceding element, if present. Can also concatenate multiple elements of a [fantasy-land compatible semigroup](https://github.com/fantasyland/fantasy-land#semigroup).
11
- * Returns undefined if empty array was passed.
12
- *
13
- * @func concatAll
14
- * @memberOf RA
15
- * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
16
- * @category List
17
- * @sig [[a]] -> [a] | Undefined
18
- * @sig [String] -> String | Undefined
19
- * @sig Semigroup s => Foldable s f => f -> s | Undefined
20
- * @param {Array.<Array|string>} list List containing elements that will be concatenated
21
- * @return {Array|string|undefined} Concatenated elements
22
- * @see {@link http://ramdajs.com/docs/#concat|R.concat}, {@link RA.concatRight|concatRight}, {@link http://ramdajs.com/docs/#unnest|R.unnest}, {@link http://ramdajs.com/docs/#join|R.join}
23
- * @example
24
- *
25
- * concatAll([[1], [2], [3]]); //=> [1, 2, 3]
26
- * concatAll(['1', '2', '3']); //=> '123'
27
- * concatAll([]); //=> undefined
28
- * concatAll(null); //=> undefined
29
- */
30
- const concatAll = pipe(
31
- reduce(concat, leftIdentitySemigroup),
32
- when(identical(leftIdentitySemigroup), stubUndefined)
33
- );
34
-
35
- export default concatAll;