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
@@ -1,40 +0,0 @@
1
- import { bind, curryN } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
- import ponyfill from './internal/ponyfills/Number.isSafeInteger.js';
5
-
6
- export const isSafeIntegerPonyfill = curryN(1, ponyfill);
7
-
8
- /**
9
- * Checks whether the passed value is a safe `integer`.
10
- *
11
- * @func isSafeInteger
12
- * @memberOf RA
13
- * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
14
- * @category Type
15
- * @sig * -> Boolean
16
- * @param {*} val The value to test
17
- * @return {boolean}
18
- * @example
19
- *
20
- * RA.isSafeInteger(3); //=> true
21
- * RA.isSafeInteger(Math.pow(2, 53)) //=> false
22
- * RA.isSafeInteger(Math.pow(2, 53) - 1); //=> true
23
- * RA.isSafeInteger(NaN); //=> false
24
- * RA.isSafeInteger(Infinity); //=> false
25
- * RA.isSafeInteger('3') //=> false
26
- * RA.isSafeInteger(3.1); //=> false
27
- * RA.isSafeInteger(3.0); //=> true
28
- * RA.isSafeInteger('string'); //=> false
29
- * RA.isSafeInteger(null); //=> false
30
- * RA.isSafeInteger(undefined); //=> false
31
- * RA.isSafeInteger({}); //=> false
32
- * RA.isSafeInteger(() => { }); //=> false
33
- * RA.isSafeInteger(true); //=> false
34
- */
35
-
36
- const isSafeInteger = isFunction(Number.isSafeInteger)
37
- ? curryN(1, bind(Number.isSafeInteger, Number))
38
- : isSafeIntegerPonyfill;
39
-
40
- export default isSafeInteger;
@@ -1,26 +0,0 @@
1
- import { curryN } from 'ramda';
2
-
3
- import isInteger32 from './isInteger32.js';
4
-
5
- /**
6
- * Checks whether the passed value is {@link https://github.com/getify/You-Dont-Know-JS/blob/9959fc904d584bbf0b02cf41c192f74ff4238581/types-grammar/ch4.md#the-curious-case-of-the-|a sentinel value}.
7
- *
8
- * @func isSentinelValue
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.33.0|v2.33.0}
11
- * @category Type
12
- * @sig * -> Boolean
13
- * @param {*} val The value to test
14
- * @return {boolean}
15
- * @example
16
- *
17
- * RA.isSentinelValue(-1); //=> true
18
- *
19
- * RA.isSentinelValue('-1'); //=> false
20
- * RA.isSentinelValue(1); //=> false
21
- * RA.isSentinelValue([-1]); //=> false
22
- */
23
- // eslint-disable-next-line no-bitwise
24
- const isSentinelValue = curryN(1, (val) => isInteger32(val) && ~val === 0);
25
-
26
- export default isSentinelValue;
package/src/isSet.js DELETED
@@ -1,24 +0,0 @@
1
- import { type, identical, pipe, curryN } from 'ramda';
2
-
3
- /**
4
- * Predicate for determining if a provided value is an instance of a Set.
5
- *
6
- * @func isSet
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link RA.isMap|isMap}}
14
- * @example
15
- *
16
- * RA.isSet(new Map()); //=> false
17
- * RA.isSet(new Set()); //=> true
18
- * RA.isSet(new Set([1,2]); //=> true
19
- * RA.isSet(new Object()); //=> false
20
- */
21
-
22
- const isSet = curryN(1, pipe(type, identical('Set')));
23
-
24
- export default isSet;
@@ -1,43 +0,0 @@
1
- import {
2
- values,
3
- both,
4
- complement,
5
- pipe,
6
- converge,
7
- identical,
8
- length,
9
- } from 'ramda';
10
-
11
- import isArray from './isArray.js';
12
-
13
- /**
14
- * Checks if input value is a sparse Array.
15
- * An array with at least one "empty slot" in it is often called a "sparse array."
16
- * Empty slot doesn't mean that the slot contains `null` or `undefined` values,
17
- * but rather that the slots don't exist.
18
- *
19
- * @func isSparseArray
20
- * @memberOf RA
21
- * @since {@link https://char0n.github.io/ramda-adjunct/2.20.0|v2.20.0}
22
- * @category Type
23
- * @sig * -> Boolean
24
- * @param {*} list The list to test
25
- * @return {boolean}
26
- * @see {@link https://github.com/getify/You-Dont-Know-JS/blob/f0d591b6502c080b92e18fc470432af8144db610/types%20%26%20grammar/ch3.md#array|Sparse Arrays}, {@link RA.isArray|isArray}
27
- * @example
28
- *
29
- * RA.isSparseArray(new Array(3)); // => true
30
- * RA.isSparseArray([1,,3]); // => true
31
- *
32
- * const list = [1, 2, 3];
33
- * delete list[1];
34
- * RA.isSparseArray(list); // => true
35
- *
36
- * RA.isSparseArray([1, 2, 3]); // => false
37
- */
38
- const isSparseArray = both(
39
- isArray,
40
- converge(complement(identical), [pipe(values, length), length])
41
- );
42
-
43
- export default isSparseArray;
package/src/isString.js DELETED
@@ -1,21 +0,0 @@
1
- import { curryN, pipe, type, identical } from 'ramda';
2
-
3
- /**
4
- * Checks if input value is `String`.
5
- *
6
- * @func isString
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/0.4.0|v0.4.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link RA.isNotString|isNotString}
14
- * @example
15
- *
16
- * RA.isString('abc'); //=> true
17
- * RA.isString(1); //=> false
18
- */
19
- const isString = curryN(1, pipe(type, identical('String')));
20
-
21
- export default isString;
package/src/isSymbol.js DELETED
@@ -1,29 +0,0 @@
1
- import { type, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if input value is a Symbol.
5
- *
6
- * @func isSymbol
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/2.22.0|v2.22.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol|MDN Symbol}
14
- * @example
15
- *
16
- * RA.isSymbol(Symbol('1')); //=> true
17
- * RA.isSymbol(Symbol(1)); //=> true
18
- * RA.isSymbol('string'); //=> false
19
- * RA.isSymbol(undefined); //=> false
20
- * RA.isSymbol(null); //=> false
21
- */
22
- const isSymbol = curryN(
23
- 1,
24
- (val) =>
25
- typeof val === 'symbol' ||
26
- (typeof val === 'object' && type(val) === 'Symbol')
27
- );
28
-
29
- export default isSymbol;
package/src/isThenable.js DELETED
@@ -1,28 +0,0 @@
1
- import { pathSatisfies } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
-
5
- /**
6
- * Checks if input value is a `thenable`.
7
- * `thenable` is an object or function that defines a `then` method.
8
- *
9
- * @func isThenable
10
- * @memberOf RA
11
- * @since {@link https://char0n.github.io/ramda-adjunct/2.1.0|v2.1.0}
12
- * @category Type
13
- * @sig * -> Boolean
14
- * @param {*} val The value to test
15
- * @return {boolean}
16
- * @see {@link RA.isPromise|isPromise}
17
- * @example
18
- *
19
- * RA.isThenable(null); // => false
20
- * RA.isThenable(undefined); // => false
21
- * RA.isThenable([]); // => false
22
- * RA.isThenable(Promise.resolve()); // => true
23
- * RA.isThenable(Promise.reject()); // => true
24
- * RA.isThenable({ then: () => 1 }); // => true
25
- */
26
- const isThenable = pathSatisfies(isFunction, ['then']);
27
-
28
- export default isThenable;
package/src/isTrue.js DELETED
@@ -1,27 +0,0 @@
1
- import { identical, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if input value is the Boolean primitive `true`. Will return false for Boolean objects
5
- * created using the `Boolean` function as a constructor.
6
- *
7
- * @func isTrue
8
- * @memberOf RA
9
- * @since {@link https://char0n.github.io/ramda-adjunct/2.6.0|v2.6.0}
10
- * @category Type
11
- * @sig * -> Boolean
12
- * @param {*} val The value to test
13
- * @return {boolean}
14
- * @see {@link RA.isFalse|isFalse}, {@link RA.isTruthy|isTruthy}, {@link RA.isFalsy|isFalsy}
15
- * @example
16
- *
17
- * RA.isTrue(true); // => true
18
- * RA.isTrue(Boolean(true)); // => true
19
- * RA.isTrue(false); // => false
20
- * RA.isTrue(1); // => false
21
- * RA.isTrue('true'); // => false
22
- * RA.isTrue(new Boolean(true)); // => false
23
- */
24
-
25
- const isTrue = curryN(1, identical(true));
26
-
27
- export default isTrue;
package/src/isTruthy.js DELETED
@@ -1,28 +0,0 @@
1
- import { curryN } from 'ramda';
2
-
3
- /**
4
- * In JavaScript, a `truthy` value is a value that is considered true
5
- * when evaluated in a Boolean context. All values are truthy unless
6
- * they are defined as falsy (i.e., except for `false`, `0`, `""`, `null`, `undefined`, and `NaN`).
7
- *
8
- * @func isTruthy
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
11
- * @category Type
12
- * @sig * -> Boolean
13
- * @param {*} val The value to test
14
- * @return {boolean}
15
- * @see {@link https://developer.mozilla.org/en-US/docs/Glossary/Truthy|truthy}, {@link RA.isFalsy|isFalsy}
16
- * @example
17
- *
18
- * RA.isTruthy({}); // => true
19
- * RA.isTruthy([]); // => true
20
- * RA.isTruthy(42); // => true
21
- * RA.isTruthy(3.14); // => true
22
- * RA.isTruthy('foo'); // => true
23
- * RA.isTruthy(new Date()); // => true
24
- * RA.isTruthy(Infinity); // => true
25
- */
26
- const isTruthy = curryN(1, Boolean);
27
-
28
- export default isTruthy;
@@ -1,29 +0,0 @@
1
- import { curryN } from 'ramda';
2
-
3
- import toUinteger32 from './toUinteger32.js';
4
-
5
- /**
6
- * Checks whether the passed value is an unsigned 32 bit integer.
7
- *
8
- * @func isUinteger32
9
- * @aliases isUint32
10
- * @memberOf RA
11
- * @since {@link https://char0n.github.io/ramda-adjunct/3.2.0|v3.2.0}
12
- * @category Type
13
- * @sig * -> Boolean
14
- * @param {*} val The value to test
15
- * @return {boolean}
16
- * @see {@link RA.toUinteger32|toUinteger32}
17
- * @example
18
- *
19
- * RA.isUinteger32(0); //=> true
20
- * RA.isUinteger32(2 ** 32 - 1); //=> true
21
- *
22
- * RA.isUinteger32(Infinity); //=> false
23
- * RA.isUinteger32(NaN); //=> false
24
- * RA.isUinteger32(-1); //=> false
25
- * RA.isUinteger32(2 ** 32); //=> false
26
- */
27
- const isUinteger32 = curryN(1, (val) => toUinteger32(val) === val);
28
-
29
- export default isUinteger32;
@@ -1,24 +0,0 @@
1
- import { equals } from 'ramda';
2
-
3
- import stubUndefined from './stubUndefined.js';
4
-
5
- /**
6
- * Checks if input value is `undefined`.
7
- *
8
- * @func isUndefined
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/0.0.1|v0.0.1}
11
- * @category Type
12
- * @sig * -> Boolean
13
- * @param {*} val The value to test
14
- * @return {boolean}
15
- * @see {@link RA.isNotUndefined|isNotUndefined}
16
- * @example
17
- *
18
- * RA.isUndefined(1); //=> false
19
- * RA.isUndefined(undefined); //=> true
20
- * RA.isUndefined(null); //=> false
21
- */
22
- const isUndefined = equals(stubUndefined());
23
-
24
- export default isUndefined;
@@ -1,29 +0,0 @@
1
- import { invoker, both, pipe, curryN } from 'ramda';
2
-
3
- import isDate from './isDate.js';
4
- import isNotNaN from './isNotNaN.js';
5
-
6
- /* eslint-disable max-len */
7
- /**
8
- * Checks if value is valid `Date` object.
9
- *
10
- * @func isValidDate
11
- * @memberOf RA
12
- * @since {@link https://char0n.github.io/ramda-adjunct/1.8.0|v1.8.0}
13
- * @category Type
14
- * @sig * -> Boolean
15
- * @param {*} val The value to test
16
- * @return {boolean}
17
- * @see {@link RA.isDate|isDate}, {@link RA.isNotDate|isNotDate}, {@link RA.isNotValidDate|isNotValidDate}
18
- * @example
19
- *
20
- * RA.isValidDate(new Date()); //=> true
21
- * RA.isValidDate(new Date('a')); //=> false
22
- */
23
- /* eslint-enable max-len */
24
- const isValidDate = curryN(
25
- 1,
26
- both(isDate, pipe(invoker(0, 'getTime'), isNotNaN))
27
- );
28
-
29
- export default isValidDate;
@@ -1,28 +0,0 @@
1
- import { either, curryN } from 'ramda';
2
-
3
- import isFloat from './isFloat.js';
4
- import isInteger from './isInteger.js';
5
-
6
- /**
7
- * Checks if value is a valid `Number`. A valid `Number` is a number that is not `NaN`, `Infinity`
8
- * or `-Infinity`.
9
- *
10
- * @func isValidNumber
11
- * @memberOf RA
12
- * @since {@link https://char0n.github.io/ramda-adjunct/2.2.0|v2.2.0}
13
- * @category Type
14
- * @sig * -> Boolean
15
- * @param {*} val The value to test
16
- * @return {boolean}
17
- * @see {@link RA.isNotValidNumber|isNotValidNumber}
18
- * @example
19
- *
20
- * RA.isValidNumber(1); //=> true
21
- * RA.isValidNumber(''); //=> false
22
- * RA.isValidNumber(NaN); //=> false
23
- * RA.isValidNumber(Infinity); //=> false
24
- * RA.isValidNumber(-Infinity); //=> false
25
- */
26
- const isValidNumber = curryN(1, either(isInteger, isFloat));
27
-
28
- export default isValidNumber;
package/src/lastP.js DELETED
@@ -1,54 +0,0 @@
1
- import { bind, last, map, curryN } from 'ramda';
2
-
3
- import allP from './allP.js';
4
- import lengthEq from './lengthEq.js';
5
- import lengthGte from './lengthGte.js';
6
- import rejectP from './rejectP.js';
7
- import resolveP from './resolveP.js';
8
-
9
- /**
10
- * Returns a promise that is fulfilled by the last 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 lastP
14
- * @memberOf RA
15
- * @category Function
16
- * @since {@link https://char0n.github.io/ramda-adjunct/2.23.0|v2.23.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 last 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.anyP|anyP}
21
- * @example
22
- *
23
- * const delayP = timeout => new Promise(resolve => setTimeout(() => resolve(timeout), timeout));
24
- * delayP.reject = timeout => new Promise((resolve, reject) => setTimeout(() => reject(timeout), timeout));
25
- * RA.lastP([
26
- * 1,
27
- * delayP(10),
28
- * delayP(100),
29
- * delayP.reject(1000),
30
- * ]); //=> Promise(100)
31
- */
32
- const lastP = curryN(1, (iterable) => {
33
- const fulfilled = [];
34
- const rejected = [];
35
- const onFulfill = bind(fulfilled.push, fulfilled);
36
- const onReject = bind(rejected.push, rejected);
37
-
38
- const listOfPromises = map(
39
- (p) => resolveP(p).then(onFulfill).catch(onReject),
40
- [...iterable]
41
- );
42
-
43
- return allP(listOfPromises).then(() => {
44
- if (lengthEq(0, fulfilled) && lengthEq(0, rejected)) {
45
- return undefined;
46
- }
47
- if (lengthGte(1, fulfilled)) {
48
- return last(fulfilled);
49
- }
50
- return rejectP(rejected);
51
- });
52
- });
53
-
54
- export default lastP;
package/src/lengthEq.js DELETED
@@ -1,24 +0,0 @@
1
- import { equals } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length equal to `valueLength`.
7
- *
8
- * @func lengthEq
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
11
- * @category List
12
- * @sig Number -> [*] -> Boolean
13
- * @param {number} valueLength The length of the list or string
14
- * @param {Array|string} value The list or string
15
- * @return {boolean}
16
- * @see {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte},, {@link http://ramdajs.com/docs/#equals|equals}, {@link http://ramdajs.com/docs/#length|length}
17
- * @example
18
- *
19
- * RA.lengthEq(3, [1,2,3]); //=> true
20
- * RA.lengthEq(3, [1,2,3,4]); //=> false
21
- */
22
- const lengthEq = compareLength(equals);
23
-
24
- export default lengthEq;
package/src/lengthGt.js DELETED
@@ -1,24 +0,0 @@
1
- import { flip, gt } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length greater than `valueLength`.
7
- *
8
- * @func lengthGt
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
11
- * @category List
12
- * @sig Number -> [*] -> Boolean
13
- * @param {number} valueLength The length of the list or string
14
- * @param {Array|string} value The list or string
15
- * @return {boolean}
16
- * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#gt|gt}, {@link http://ramdajs.com/docs/#length|length}
17
- * @example
18
- *
19
- * RA.lengthGt(3, [1,2,3,4]); //=> true
20
- * RA.lengthGt(3, [1,2,3]); //=> false
21
- */
22
- const lengthGt = compareLength(flip(gt));
23
-
24
- export default lengthGt;
package/src/lengthGte.js DELETED
@@ -1,26 +0,0 @@
1
- import { flip, gte } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length greater than or equal to
7
- * `valueLength`.
8
- *
9
- * @func lengthGte
10
- * @memberOf RA
11
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
12
- * @category List
13
- * @sig Number -> [*] -> Boolean
14
- * @param {number} valueLength The length of the list or string
15
- * @param {Array|string} value The list or string
16
- * @return {boolean}
17
- * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link http://ramdajs.com/docs/#gte|gte}, {@link http://ramdajs.com/docs/#length|length}
18
- * @example
19
- *
20
- * RA.lengthGte(3, [1,2,3,4]); //=> true
21
- * RA.lengthGte(3, [1,2,3]); //=> true
22
- * RA.lengthGte(3, [1,2]); //=> false
23
- */
24
- const lengthGte = compareLength(flip(gte));
25
-
26
- export default lengthGte;
package/src/lengthLt.js DELETED
@@ -1,24 +0,0 @@
1
- import { flip, lt } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length less than `valueLength`.
7
- *
8
- * @func lengthLt
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
11
- * @category List
12
- * @sig Number -> [*] -> Boolean
13
- * @param {number} valueLength The length of the list or string
14
- * @param {Array|string} value The list or string
15
- * @return {boolean}
16
- * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#lt|lt}, {@link http://ramdajs.com/docs/#length|length}
17
- * @example
18
- *
19
- * RA.lengthLt(3, [1,2]); //=> true
20
- * RA.lengthLt(3, [1,2,3]); //=> false
21
- */
22
- const lengthLt = compareLength(flip(lt));
23
-
24
- export default lengthLt;
package/src/lengthLte.js DELETED
@@ -1,25 +0,0 @@
1
- import { flip, lte } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length less than or equal to `valueLength`.
7
- *
8
- * @func lengthLte
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
11
- * @category List
12
- * @sig Number -> [*] -> Boolean
13
- * @param {number} valueLength The length of the list or string
14
- * @param {Array|string} value The list or string
15
- * @return {boolean}
16
- * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthNotEq|lengthNotEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#lte|lte}, {@link http://ramdajs.com/docs/#length|length}
17
- * @example
18
- *
19
- * RA.lengthLte(3, [1,2]); //=> true
20
- * RA.lengthLte(3, [1,2,3]); //=> true
21
- * RA.lengthLte(3, [1,2,3,4]); //=> false
22
- */
23
- const lengthLte = compareLength(flip(lte));
24
-
25
- export default lengthLte;
@@ -1,24 +0,0 @@
1
- import { complement, equals } from 'ramda';
2
-
3
- import compareLength from './internal/compareLength.js';
4
-
5
- /**
6
- * Returns `true` if the supplied list or string has a length not equal to `valueLength`.
7
- *
8
- * @func lengthNotEq
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.8.0|v2.8.0}
11
- * @category List
12
- * @sig Number -> [*] -> Boolean
13
- * @param {number} valueLength The length of the list or string
14
- * @param {Array|string} value The list or string
15
- * @return {boolean}
16
- * @see {@link RA.lengthEq|lengthEq}, {@link RA.lengthLt|lengthLt}, {@link RA.lengthGt|lengthGt}, {@link RA.lengthLte|lengthLte}, {@link RA.lengthGte|lengthGte}, {@link http://ramdajs.com/docs/#equals|equals}, {@link http://ramdajs.com/docs/#length|length}
17
- * @example
18
- *
19
- * RA.lengthNotEq(3, [1,2,3,4]); //=> true
20
- * RA.lengthNotEq(3, [1,2,3]); //=> false
21
- */
22
- const lengthNotEq = compareLength(complement(equals));
23
-
24
- export default lengthNotEq;
package/src/lensEq.js DELETED
@@ -1,28 +0,0 @@
1
- import { view, curryN, equals, pipe } from 'ramda';
2
-
3
- /**
4
- * Returns `true` if data structure focused by the given lens equals provided value.
5
- *
6
- * @func lensEq
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/1.13.0|1.13.0}
9
- * @category Relation
10
- * @typedef Lens s a = Functor f => (a -> f a) -> s -> f s
11
- * @sig Lens s a -> b -> s -> Boolean
12
- * @see {@link RA.lensNotEq|lensNotEq}
13
- * @param {function} lens Van Laarhoven lens
14
- * @param {*} value The value to compare the focused data structure with
15
- * @param {*} data The data structure
16
- * @return {boolean} `true` if the focused data structure equals value, `false` otherwise
17
- *
18
- * @example
19
- *
20
- * RA.lensEq(R.lensIndex(0), 1, [0, 1, 2]); // => false
21
- * RA.lensEq(R.lensIndex(1), 1, [0, 1, 2]); // => true
22
- * RA.lensEq(R.lensPath(['a', 'b']), 'foo', { a: { b: 'foo' } }) // => true
23
- */
24
- const lensEq = curryN(3, (lens, val, data) =>
25
- pipe(view(lens), equals(val))(data)
26
- );
27
-
28
- export default lensEq;