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,3 +0,0 @@
1
- const isOfTypeObject = (val) => typeof val === 'object';
2
-
3
- export default isOfTypeObject;
@@ -1,42 +0,0 @@
1
- import isArrayLike from '../isArrayLike.js';
2
-
3
- /**
4
- * `makeFlat` is a helper function that returns a one-level or fully recursive
5
- * function based on the flag passed in.
6
- *
7
- * @func makeFlat
8
- * @memberOf RA
9
- *
10
- * @category List
11
- * @param {!bool} = should recursively flatten
12
- * @param {!Array} = the nested list to be flattened
13
- * @return {!Array} = the flattened list
14
- * @sig Bool -> List -> List
15
- *
16
- */
17
- const makeFlat = (recursive) =>
18
- function flatt(list) {
19
- let value;
20
- let jlen;
21
- let j;
22
- const result = [];
23
- let idx = 0;
24
-
25
- while (idx < list.length) {
26
- if (isArrayLike(list[idx])) {
27
- value = recursive ? flatt(list[idx]) : list[idx];
28
- j = 0;
29
- jlen = value.length;
30
- while (j < jlen) {
31
- result[result.length] = value[j];
32
- j += 1;
33
- }
34
- } else {
35
- result[result.length] = list[idx];
36
- }
37
- idx += 1;
38
- }
39
- return result;
40
- };
41
-
42
- export default makeFlat;
@@ -1,34 +0,0 @@
1
- import { bind } from 'ramda';
2
-
3
- import isIterable from '../../isIterable.js';
4
- import isNotUndefined from '../../isNotUndefined.js';
5
- import isNotNil from '../../isNotNil.js';
6
- import isNotFunction from '../../isNotFunction.js';
7
-
8
- const copyArray = (items, mapFn, thisArg) => {
9
- const boundMapFn = isNotUndefined(thisArg) ? bind(mapFn, thisArg) : mapFn;
10
-
11
- return isNotUndefined(mapFn) ? [...items].map(boundMapFn) : [...items];
12
- };
13
-
14
- const fromArray = (items, mapFn, thisArg) => {
15
- if (items == null) {
16
- throw new TypeError(
17
- 'Array.from requires an array-like object - not null or undefined'
18
- );
19
- }
20
-
21
- if (isNotNil(mapFn) && isNotFunction(mapFn)) {
22
- throw new TypeError(
23
- 'Array.from: when provided, the second argument must be a function'
24
- );
25
- }
26
-
27
- if (isIterable(items)) {
28
- return copyArray(items, mapFn, thisArg);
29
- }
30
-
31
- return [];
32
- };
33
-
34
- export default fromArray;
@@ -1,3 +0,0 @@
1
- const signPonyfill = (number) => (number > 0) - (number < 0) || +number;
2
-
3
- export default signPonyfill;
@@ -1,14 +0,0 @@
1
- import isFinite from '../../isFinite.js';
2
-
3
- const truncPonyfill = (v) => {
4
- const numV = Number(v);
5
-
6
- if (!isFinite(numV)) {
7
- return numV;
8
- }
9
-
10
- // eslint-disable-next-line no-nested-ternary
11
- return numV - (numV % 1) || (numV < 0 ? -0 : numV === 0 ? numV : 0);
12
- };
13
-
14
- export default truncPonyfill;
@@ -1,3 +0,0 @@
1
- const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 2 ** 53 - 1;
2
-
3
- export default MAX_SAFE_INTEGER;
@@ -1,3 +0,0 @@
1
- const MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -(2 ** 53) - 1;
2
-
3
- export default MIN_SAFE_INTEGER;
@@ -1,8 +0,0 @@
1
- import { both } from 'ramda';
2
-
3
- import isNumber from '../../isNumber.js';
4
-
5
- // eslint-disable-next-line no-restricted-globals
6
- const isFinitePonyfill = both(isNumber, isFinite);
7
-
8
- export default isFinitePonyfill;
@@ -1,10 +0,0 @@
1
- import { both, converge, equals, identity } from 'ramda';
2
-
3
- import isFinite from '../../isFinite.js';
4
-
5
- const isIntegerPonyfill = both(
6
- isFinite,
7
- converge(equals, [Math.floor, identity])
8
- );
9
-
10
- export default isIntegerPonyfill;
@@ -1,8 +0,0 @@
1
- import { both } from 'ramda';
2
-
3
- import isNumber from '../../isNumber.js';
4
-
5
- // eslint-disable-next-line no-restricted-globals
6
- const isNaNPonyfill = both(isNumber, isNaN);
7
-
8
- export default isNaNPonyfill;
@@ -1,11 +0,0 @@
1
- import { both } from 'ramda';
2
-
3
- import isInteger from '../../isInteger.js';
4
- import MAX_SAFE_INTEGER from './Number.MAX_SAFE_INTEGER.js';
5
-
6
- const isSafeIntegerPonyfill = both(
7
- isInteger,
8
- (value) => Math.abs(value) <= MAX_SAFE_INTEGER
9
- );
10
-
11
- export default isSafeIntegerPonyfill;
@@ -1,18 +0,0 @@
1
- import { map } from 'ramda';
2
-
3
- import allP from '../../allP.js';
4
- import resolveP from '../../resolveP.js';
5
-
6
- const onFulfill = (value) => ({ status: 'fulfilled', value });
7
- const onReject = (reason) => ({ status: 'rejected', reason });
8
-
9
- const allSettledPonyfill = (iterable) => {
10
- const array = map(
11
- (p) => resolveP(p).then(onFulfill).catch(onReject),
12
- [...iterable]
13
- );
14
-
15
- return allP(array);
16
- };
17
-
18
- export default allSettledPonyfill;
@@ -1,29 +0,0 @@
1
- import { map } from 'ramda';
2
-
3
- import resolveP from '../../resolveP.js';
4
-
5
- export class AggregatedError extends Error {
6
- constructor(errors = [], message = '') {
7
- super(message);
8
-
9
- this.errors = errors;
10
- }
11
- }
12
-
13
- const anyPonyfill = (iterable) => {
14
- const exceptions = [];
15
-
16
- return new Promise((resolve, reject) => {
17
- const onReject = (e) => {
18
- exceptions.push(e);
19
-
20
- if (exceptions.length === iterable.length) {
21
- reject(new AggregatedError(exceptions));
22
- }
23
- };
24
-
25
- map((p) => resolveP(p).then(resolve).catch(onReject), [...iterable]);
26
- });
27
- };
28
-
29
- export default anyPonyfill;
@@ -1,25 +0,0 @@
1
- import isFunction from '../../isFunction.js';
2
- import isNotUndefined from '../../isNotUndefined.js';
3
- import repeat from './String.repeat.js';
4
-
5
- const padEndPonyfill = (padString, targetLength, value) => {
6
- // eslint-disable-next-line no-bitwise
7
- let finalLength = targetLength >> 0;
8
- let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
9
-
10
- if (value.length > finalLength) {
11
- return String(value);
12
- }
13
-
14
- finalLength -= value.length;
15
- if (finalLength > finalPadString.length) {
16
- const remainingLength = finalLength / finalPadString.length;
17
- finalPadString += isFunction(String.prototype.repeat)
18
- ? finalPadString.repeat(remainingLength)
19
- : repeat(finalPadString, remainingLength);
20
- }
21
-
22
- return String(value) + finalPadString.slice(0, finalLength);
23
- };
24
-
25
- export default padEndPonyfill;
@@ -1,27 +0,0 @@
1
- import isFunction from '../../isFunction.js';
2
- import isNotUndefined from '../../isNotUndefined.js';
3
- import repeat from './String.repeat.js';
4
-
5
- const padStartPonyfill = (padString, targetLength, value) => {
6
- // eslint-disable-next-line no-bitwise
7
- let finalLength = targetLength >> 0; // truncate if number, or convert non-number to 0;
8
- let finalPadString = String(isNotUndefined(padString) ? padString : ' ');
9
-
10
- // return the original string, if targeted length is less than original strings length
11
- if (value.length >= finalLength) {
12
- return String(value);
13
- }
14
-
15
- finalLength -= value.length;
16
- if (finalLength > finalPadString.length) {
17
- const lenghtToPad = finalLength / finalPadString.length;
18
- // append to original to ensure we are longer than needed
19
- finalPadString += isFunction(String.prototype.repeat)
20
- ? finalPadString.repeat(lenghtToPad)
21
- : repeat(finalPadString, lenghtToPad);
22
- }
23
-
24
- return finalPadString.slice(0, finalLength) + String(value);
25
- };
26
-
27
- export default padStartPonyfill;
@@ -1,49 +0,0 @@
1
- import isNotFinite from '../../isNotFinite.js';
2
- import isNegative from '../../isNegative.js';
3
-
4
- const repeat = (value, count) => {
5
- let validCount = Number(count);
6
-
7
- if (validCount !== count) {
8
- validCount = 0;
9
- }
10
-
11
- if (isNegative(validCount)) {
12
- throw new RangeError('repeat count must be non-negative');
13
- }
14
-
15
- if (isNotFinite(validCount)) {
16
- throw new RangeError('repeat count must be less than infinity');
17
- }
18
-
19
- validCount = Math.floor(validCount);
20
-
21
- if (value.length === 0 || validCount === 0) {
22
- return '';
23
- }
24
-
25
- // Ensuring validCount is a 31-bit integer allows us to heavily optimize the
26
- // main part. But anyway, most current (August 2014) browsers can't handle
27
- // strings 1 << 28 chars or longer, so:
28
- // eslint-disable-next-line no-bitwise
29
- if (value.length * validCount >= 1 << 28) {
30
- throw new RangeError('repeat count must not overflow maximum string size');
31
- }
32
-
33
- const maxCount = value.length * validCount;
34
-
35
- validCount = Math.floor(Math.log(validCount) / Math.log(2));
36
-
37
- let result = value;
38
-
39
- while (validCount) {
40
- result += value;
41
- validCount -= 1;
42
- }
43
-
44
- result += result.substring(0, maxCount - result.length);
45
-
46
- return result;
47
- };
48
-
49
- export default repeat;
@@ -1,44 +0,0 @@
1
- import { replace } from 'ramda';
2
-
3
- import isRegExp from '../../isRegExp.js';
4
- import escapeRegExp from '../../escapeRegExp.js';
5
-
6
- const checkArguments = (searchValue, replaceValue, str) => {
7
- if (str == null || searchValue == null || replaceValue == null) {
8
- throw TypeError('Input values must not be `null` or `undefined`');
9
- }
10
- };
11
-
12
- const checkValue = (value, valueName) => {
13
- if (typeof value !== 'string') {
14
- if (!(value instanceof String)) {
15
- throw TypeError(`\`${valueName}\` must be a string`);
16
- }
17
- }
18
- };
19
-
20
- const checkSearchValue = (searchValue) => {
21
- if (
22
- typeof searchValue !== 'string' &&
23
- !(searchValue instanceof String) &&
24
- !(searchValue instanceof RegExp)
25
- ) {
26
- throw TypeError('`searchValue` must be a string or an regexp');
27
- }
28
- };
29
-
30
- const replaceAll = (searchValue, replaceValue, str) => {
31
- checkArguments(searchValue, replaceValue, str);
32
- checkValue(str, 'str');
33
- checkValue(replaceValue, 'replaceValue');
34
- checkSearchValue(searchValue);
35
-
36
- const regexp = new RegExp(
37
- isRegExp(searchValue) ? searchValue : escapeRegExp(searchValue),
38
- 'g'
39
- );
40
-
41
- return replace(regexp, replaceValue, str);
42
- };
43
-
44
- export default replaceAll;
@@ -1,5 +0,0 @@
1
- import { replace } from 'ramda';
2
-
3
- const trimStart = replace(/[\s\uFEFF\xA0]+$/, '');
4
-
5
- export default trimStart;
@@ -1,5 +0,0 @@
1
- import { replace } from 'ramda';
2
-
3
- const trimStart = replace(/^[\s\uFEFF\xA0]+/, '');
4
-
5
- export default trimStart;
package/src/invoke.js DELETED
@@ -1,22 +0,0 @@
1
- import { __ } from 'ramda';
2
-
3
- import invokeArgs from './invokeArgs.js';
4
-
5
- /**
6
- * Invokes the method at path of object.
7
- *
8
- * @func invoke
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/2.31.0|v2.31.0}
11
- * @category Object
12
- * @sig Array -> Object -> *
13
- * @param {Array.<string|number>} path The path of the method to invoke
14
- * @param {Object} obj The object to query
15
- * @return {*}
16
- * @example
17
- *
18
- * RA.invoke(['random'], Math); //=> 0.5113253820009047
19
- */
20
- const invoke = invokeArgs(__, [], __);
21
-
22
- export default invoke;
package/src/invokeArgs.js DELETED
@@ -1,36 +0,0 @@
1
- import { curryN, path, apply, init, bind } from 'ramda';
2
-
3
- import isNotFunction from './isNotFunction.js';
4
- import isEmptyArray from './isEmptyArray.js';
5
-
6
- /**
7
- * Invokes the method at path of object with given arguments.
8
- *
9
- * @func invokeArgs
10
- * @memberOf RA
11
- * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
12
- * @category Object
13
- * @sig Array -> Array -> Object -> *
14
- * @param {Array.<string|number>} path The path of the method to invoke
15
- * @param {Array} args The arguments to invoke the method with
16
- * @param {Object} obj The object to query
17
- * @return {*}
18
- * @example
19
- *
20
- * RA.invokeArgs(['abs'], [-1], Math); //=> 1
21
- * RA.invokeArgs(['path', 'to', 'non-existent', 'method'], [-1], Math); //=> undefined
22
- */
23
-
24
- const invokeArgs = curryN(3, (mpath, args, obj) => {
25
- const method = path(mpath, obj);
26
- const context = path(init(mpath), obj);
27
-
28
- if (isNotFunction(method)) return undefined;
29
- if (isEmptyArray(mpath)) return undefined;
30
-
31
- const boundMethod = bind(method, context);
32
-
33
- return apply(boundMethod, args);
34
- });
35
-
36
- export default invokeArgs;
package/src/isArray.js DELETED
@@ -1,27 +0,0 @@
1
- import { curryN, pipe, type, identical } from 'ramda';
2
-
3
- import isFunction from './isFunction.js';
4
-
5
- /**
6
- * Checks if input value is `Array`.
7
- *
8
- * @func isArray
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
11
- * @category Type
12
- * @sig * -> Boolean
13
- * @param {*} val The value to test
14
- * @return {boolean}
15
- * @see {@link RA.isNotArray|isNotArray}
16
- * @example
17
- *
18
- * RA.isArray([]); //=> true
19
- * RA.isArray(null); //=> false
20
- * RA.isArray({}); //=> false
21
- */
22
- const isArray = curryN(
23
- 1,
24
- isFunction(Array.isArray) ? Array.isArray : pipe(type, identical('Array'))
25
- );
26
-
27
- export default isArray;
@@ -1,79 +0,0 @@
1
- import { has, curryN } from 'ramda';
2
-
3
- import isArray from './isArray.js';
4
- import isString from './isString.js';
5
-
6
- /* eslint-disable max-len */
7
- /**
8
- * Tests whether or not an object is similar to an array.
9
- *
10
- * @func isArrayLike
11
- * @memberOf RA
12
- * @since {@link https://char0n.github.io/ramda-adjunct/1.9.0|v1.9.0}
13
- * @licence https://github.com/ramda/ramda/blob/master/LICENSE.txt
14
- * @category List
15
- * @category Type
16
- * @sig * -> Boolean
17
- * @param {*} val The value to test
18
- * @returns {boolean} `true` if `val` has a numeric length property and extreme indices defined; `false` otherwise.
19
- * @see {@link RA.isNotArrayLike|isNotArrayLike}
20
-
21
- * @example
22
- *
23
- * RA.isArrayLike([]); //=> true
24
- * RA.isArrayLike(true); //=> false
25
- * RA.isArrayLike({}); //=> false
26
- * RA.isArrayLike({length: 10}); //=> false
27
- * RA.isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
28
- */
29
- /* eslint-enable max-len */
30
- const isArrayLike = curryN(1, (val) => {
31
- if (isArray(val)) {
32
- return true;
33
- }
34
- if (!val) {
35
- return false;
36
- }
37
- if (isString(val)) {
38
- return false;
39
- }
40
- if (typeof val !== 'object') {
41
- return false;
42
- }
43
- if (val.nodeType === 1) {
44
- return !!val.length;
45
- }
46
- if (val.length === 0) {
47
- return true;
48
- }
49
- if (val.length > 0) {
50
- return has(0, val) && has(val.length - 1, val);
51
- }
52
- return false;
53
- });
54
-
55
- export default isArrayLike;
56
-
57
- /**
58
- The MIT License (MIT)
59
-
60
- Copyright (c) 2013-2016 Scott Sauyet and Michael Hurley
61
-
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
-
69
- The above copyright notice and this permission notice shall be included in
70
- all copies or substantial portions of the Software.
71
-
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
78
- THE SOFTWARE.
79
- */
@@ -1,23 +0,0 @@
1
- import { pipe, type, identical, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if input value is `Async Function`.
5
- *
6
- * @func isAsyncFunction
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/0.5.0|v0.5.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link RA.isFunction|isFunction}, {@link RA.isNotAsyncFunction|isNotAsyncFunction}, {@link RA.isGeneratorFunction|isGeneratorFunction}
14
- * @example
15
- *
16
- * RA.isAsyncFunction(async function test() { }); //=> true
17
- * RA.isAsyncFunction(null); //=> false
18
- * RA.isAsyncFunction(function test() { }); //=> false
19
- * RA.isAsyncFunction(() => {}); //=> false
20
- */
21
- const isAsyncFunction = curryN(1, pipe(type, identical('AsyncFunction')));
22
-
23
- export default isAsyncFunction;
package/src/isBigInt.js DELETED
@@ -1,24 +0,0 @@
1
- import { type, pipe, identical, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if value is a BigInt.
5
- *
6
- * @func isBigInt
7
- * @memberOf RA
8
- * @category Type
9
- * @since {@link https://char0n.github.io/ramda-adjunct/2.27.0|v2.27.0}
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @example
14
- *
15
- * RA.isBigInt(5); // => false
16
- * RA.isBigInt(Number.MAX_VALUE); // => false
17
- * RA.isBigInt(-Infinity); // => false
18
- * RA.isBigInt(10); // => false
19
- * RA.isBigInt(10n); // => true
20
- * RA.isBigInt(BitInt(9007199254740991)); // => true
21
- */
22
- const isBigInt = curryN(1, pipe(type, identical('BigInt')));
23
-
24
- export default isBigInt;
package/src/isBlank.js DELETED
@@ -1,33 +0,0 @@
1
- import { isEmpty, isNil, anyPass, test } from 'ramda';
2
-
3
- import isFalse from './isFalse.js';
4
- /**
5
- * Returns `true` if the given value is its type's empty value, `false`, `undefined`
6
- * as well as strings containing only whitespace characters; `false` otherwise.
7
- *
8
- * @func isBlank
9
- * @memberOf RA
10
- * @since {@link https://char0n.github.io/ramda-adjunct/3.1.0|v3.1.0}
11
- * @category Type
12
- * @sig * -> Boolean
13
- * @param {*} val The value to test
14
- * @return {boolean}
15
- * @see {@link https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html|Differences Between #nil?, #empty?, #blank?, and #present?}
16
- * @example
17
- *
18
- * RA.isBlank(''); //=> true
19
- * RA.isBlank(' '); //=> true
20
- * RA.isBlank('\t\n'); //=> true
21
- * RA.isBlank({}); //=> true
22
- * RA.isBlank(null); //=> true
23
- * RA.isBlank(undefined); //=> true
24
- * RA.isBlank([]); //=> true
25
- * RA.isBlank(false); //=> true
26
- * RA.isBlank('value'); //=> false
27
- * RA.isBlank({ foo: 'foo' }); //=> false
28
- * RA.isBlank([1, 2, 3]); //=> false
29
- * RA.isBlank(true); //=> false
30
- */
31
- const isBlank = anyPass([isFalse, isNil, isEmpty, test(/^\s+$/gm)]);
32
-
33
- export default isBlank;
package/src/isBoolean.js DELETED
@@ -1,22 +0,0 @@
1
- import { type, identical, pipe, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if input value is `Boolean`.
5
- *
6
- * @func isBoolean
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/0.3.0|v0.3.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link RA.isNotBoolean|isNotBoolean}
14
- * @example
15
- *
16
- * RA.isBoolean(false); //=> true
17
- * RA.isBoolean(true); //=> true
18
- * RA.isBoolean(null); //=> false
19
- */
20
- const isBoolean = curryN(1, pipe(type, identical('Boolean')));
21
-
22
- export default isBoolean;
package/src/isDate.js DELETED
@@ -1,21 +0,0 @@
1
- import { type, identical, pipe, curryN } from 'ramda';
2
-
3
- /**
4
- * Checks if value is `Date` object.
5
- *
6
- * @func isDate
7
- * @memberOf RA
8
- * @since {@link https://char0n.github.io/ramda-adjunct/0.6.0|v0.6.0}
9
- * @category Type
10
- * @sig * -> Boolean
11
- * @param {*} val The value to test
12
- * @return {boolean}
13
- * @see {@link RA.isNotDate|isNotDate}, {@link RA.isValidDate|isValidDate}, {@link RA.isNotValidDate|isNotValidDate}
14
- * @example
15
- *
16
- * RA.isDate(new Date()); //=> true
17
- * RA.isDate('1997-07-16T19:20+01:00'); //=> false
18
- */
19
- const isDate = curryN(1, pipe(type, identical('Date')));
20
-
21
- export default isDate;