rubico 2.7.9 → 2.8.0

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 (343) hide show
  1. package/README.md +2 -2
  2. package/_internal/arraySome.js +6 -6
  3. package/_internal/asyncIteratorEvery.js +10 -10
  4. package/_internal/asyncIteratorSome.js +9 -9
  5. package/_internal/curryArity.js +14 -12
  6. package/_internal/mapMapEntries.js +1 -1
  7. package/_internal/objectMapEntries.js +1 -1
  8. package/curry.js +59 -3
  9. package/dist/Transducer.es.js +1 -1
  10. package/dist/Transducer.es.min.js +1 -1
  11. package/dist/Transducer.js +1 -1
  12. package/dist/Transducer.min.js +2 -2
  13. package/dist/Transducer.mjs +1 -1
  14. package/dist/__.es.js +1 -1
  15. package/dist/__.es.min.js +1 -1
  16. package/dist/__.js +1 -1
  17. package/dist/__.min.js +2 -2
  18. package/dist/__.mjs +1 -1
  19. package/dist/all.es.js +1 -1
  20. package/dist/all.es.min.js +1 -1
  21. package/dist/all.js +1 -1
  22. package/dist/all.min.js +2 -2
  23. package/dist/all.mjs +1 -1
  24. package/dist/always.es.js +1 -1
  25. package/dist/always.es.min.js +1 -1
  26. package/dist/always.js +1 -1
  27. package/dist/always.min.js +2 -2
  28. package/dist/always.mjs +1 -1
  29. package/dist/and.es.js +1 -1
  30. package/dist/and.es.min.js +1 -1
  31. package/dist/and.js +1 -1
  32. package/dist/and.min.js +2 -2
  33. package/dist/and.mjs +1 -1
  34. package/dist/assign.es.js +1 -1
  35. package/dist/assign.es.min.js +1 -1
  36. package/dist/assign.js +1 -1
  37. package/dist/assign.min.js +2 -2
  38. package/dist/assign.mjs +1 -1
  39. package/dist/compose.es.js +1 -1
  40. package/dist/compose.es.min.js +1 -1
  41. package/dist/compose.js +1 -1
  42. package/dist/compose.min.js +2 -2
  43. package/dist/compose.mjs +1 -1
  44. package/dist/curry.es.js +17 -13
  45. package/dist/curry.es.min.js +2 -2
  46. package/dist/curry.js +17 -13
  47. package/dist/curry.min.js +2 -2
  48. package/dist/curry.mjs +17 -13
  49. package/dist/eq.es.js +1 -1
  50. package/dist/eq.es.min.js +1 -1
  51. package/dist/eq.js +1 -1
  52. package/dist/eq.min.js +2 -2
  53. package/dist/eq.mjs +1 -1
  54. package/dist/every.es.js +9 -9
  55. package/dist/every.es.min.js +2 -2
  56. package/dist/every.js +9 -9
  57. package/dist/every.min.js +2 -2
  58. package/dist/every.mjs +9 -9
  59. package/dist/filter.es.js +1 -1
  60. package/dist/filter.es.min.js +1 -1
  61. package/dist/filter.js +1 -1
  62. package/dist/filter.min.js +2 -2
  63. package/dist/filter.mjs +1 -1
  64. package/dist/flatMap.es.js +1 -1
  65. package/dist/flatMap.es.min.js +2 -2
  66. package/dist/flatMap.js +1 -1
  67. package/dist/flatMap.min.js +2 -2
  68. package/dist/flatMap.mjs +1 -1
  69. package/dist/forEach.es.js +1 -1
  70. package/dist/forEach.es.min.js +1 -1
  71. package/dist/forEach.js +1 -1
  72. package/dist/forEach.min.js +2 -2
  73. package/dist/forEach.mjs +1 -1
  74. package/dist/get.es.js +1 -1
  75. package/dist/get.es.min.js +1 -1
  76. package/dist/get.js +1 -1
  77. package/dist/get.min.js +2 -2
  78. package/dist/get.mjs +1 -1
  79. package/dist/gt.es.js +1 -1
  80. package/dist/gt.es.min.js +1 -1
  81. package/dist/gt.js +1 -1
  82. package/dist/gt.min.js +2 -2
  83. package/dist/gt.mjs +1 -1
  84. package/dist/gte.es.js +1 -1
  85. package/dist/gte.es.min.js +1 -1
  86. package/dist/gte.js +1 -1
  87. package/dist/gte.min.js +2 -2
  88. package/dist/gte.mjs +1 -1
  89. package/dist/lt.es.js +1 -1
  90. package/dist/lt.es.min.js +1 -1
  91. package/dist/lt.js +1 -1
  92. package/dist/lt.min.js +2 -2
  93. package/dist/lt.mjs +1 -1
  94. package/dist/lte.es.js +1 -1
  95. package/dist/lte.es.min.js +1 -1
  96. package/dist/lte.js +1 -1
  97. package/dist/lte.min.js +2 -2
  98. package/dist/lte.mjs +1 -1
  99. package/dist/map.es.js +13 -13
  100. package/dist/map.es.min.js +2 -2
  101. package/dist/map.js +13 -13
  102. package/dist/map.min.js +2 -2
  103. package/dist/map.mjs +13 -13
  104. package/dist/not.es.js +1 -1
  105. package/dist/not.es.min.js +1 -1
  106. package/dist/not.js +1 -1
  107. package/dist/not.min.js +2 -2
  108. package/dist/not.mjs +1 -1
  109. package/dist/omit.es.js +1 -1
  110. package/dist/omit.es.min.js +1 -1
  111. package/dist/omit.js +1 -1
  112. package/dist/omit.min.js +2 -2
  113. package/dist/omit.mjs +1 -1
  114. package/dist/or.es.js +1 -1
  115. package/dist/or.es.min.js +1 -1
  116. package/dist/or.js +1 -1
  117. package/dist/or.min.js +2 -2
  118. package/dist/or.mjs +1 -1
  119. package/dist/pick.es.js +1 -1
  120. package/dist/pick.es.min.js +1 -1
  121. package/dist/pick.js +1 -1
  122. package/dist/pick.min.js +2 -2
  123. package/dist/pick.mjs +1 -1
  124. package/dist/pipe.es.js +1 -1
  125. package/dist/pipe.es.min.js +1 -1
  126. package/dist/pipe.js +1 -1
  127. package/dist/pipe.min.js +2 -2
  128. package/dist/pipe.mjs +1 -1
  129. package/dist/reduce.es.js +1 -1
  130. package/dist/reduce.es.min.js +1 -1
  131. package/dist/reduce.js +1 -1
  132. package/dist/reduce.min.js +2 -2
  133. package/dist/reduce.mjs +1 -1
  134. package/dist/rubico.es.js +40 -36
  135. package/dist/rubico.es.min.js +2 -2
  136. package/dist/rubico.global.js +40 -36
  137. package/dist/rubico.global.min.js +2 -2
  138. package/dist/rubico.js +40 -36
  139. package/dist/rubico.min.js +2 -2
  140. package/dist/rubico.mjs +40 -36
  141. package/dist/set.es.js +1 -1
  142. package/dist/set.es.min.js +1 -1
  143. package/dist/set.js +1 -1
  144. package/dist/set.min.js +2 -2
  145. package/dist/set.mjs +1 -1
  146. package/dist/some.es.js +14 -14
  147. package/dist/some.es.min.js +2 -2
  148. package/dist/some.js +14 -14
  149. package/dist/some.min.js +2 -2
  150. package/dist/some.mjs +14 -14
  151. package/dist/switchCase.es.js +1 -1
  152. package/dist/switchCase.es.min.js +1 -1
  153. package/dist/switchCase.js +1 -1
  154. package/dist/switchCase.min.js +2 -2
  155. package/dist/switchCase.mjs +1 -1
  156. package/dist/tap.es.js +1 -1
  157. package/dist/tap.es.min.js +1 -1
  158. package/dist/tap.js +1 -1
  159. package/dist/tap.min.js +2 -2
  160. package/dist/tap.mjs +1 -1
  161. package/dist/thunkify.es.js +1 -1
  162. package/dist/thunkify.es.min.js +1 -1
  163. package/dist/thunkify.js +1 -1
  164. package/dist/thunkify.min.js +2 -2
  165. package/dist/thunkify.mjs +1 -1
  166. package/dist/transform.es.js +1 -1
  167. package/dist/transform.es.min.js +1 -1
  168. package/dist/transform.js +1 -1
  169. package/dist/transform.min.js +2 -2
  170. package/dist/transform.mjs +1 -1
  171. package/dist/tryCatch.es.js +1 -1
  172. package/dist/tryCatch.es.min.js +1 -1
  173. package/dist/tryCatch.js +1 -1
  174. package/dist/tryCatch.min.js +2 -2
  175. package/dist/tryCatch.mjs +1 -1
  176. package/dist/x/append.es.js +1 -1
  177. package/dist/x/append.es.min.js +1 -1
  178. package/dist/x/append.js +1 -1
  179. package/dist/x/append.min.js +2 -2
  180. package/dist/x/append.mjs +1 -1
  181. package/dist/x/callProp.es.js +1 -1
  182. package/dist/x/callProp.es.min.js +1 -1
  183. package/dist/x/callProp.js +1 -1
  184. package/dist/x/callProp.min.js +2 -2
  185. package/dist/x/callProp.mjs +1 -1
  186. package/dist/x/defaultsDeep.es.js +1 -1
  187. package/dist/x/defaultsDeep.es.min.js +1 -1
  188. package/dist/x/defaultsDeep.js +1 -1
  189. package/dist/x/defaultsDeep.min.js +2 -2
  190. package/dist/x/defaultsDeep.mjs +1 -1
  191. package/dist/x/differenceWith.es.js +6 -6
  192. package/dist/x/differenceWith.es.min.js +2 -2
  193. package/dist/x/differenceWith.js +6 -6
  194. package/dist/x/differenceWith.min.js +2 -2
  195. package/dist/x/differenceWith.mjs +6 -6
  196. package/dist/x/filterOut.es.js +1 -1
  197. package/dist/x/filterOut.es.min.js +1 -1
  198. package/dist/x/filterOut.js +1 -1
  199. package/dist/x/filterOut.min.js +2 -2
  200. package/dist/x/filterOut.mjs +1 -1
  201. package/dist/x/find.es.js +1 -1
  202. package/dist/x/find.es.min.js +1 -1
  203. package/dist/x/find.js +1 -1
  204. package/dist/x/find.min.js +2 -2
  205. package/dist/x/find.mjs +1 -1
  206. package/dist/x/findIndex.es.js +1 -1
  207. package/dist/x/findIndex.es.min.js +1 -1
  208. package/dist/x/findIndex.js +1 -1
  209. package/dist/x/findIndex.min.js +2 -2
  210. package/dist/x/findIndex.mjs +1 -1
  211. package/dist/x/first.es.js +1 -1
  212. package/dist/x/first.es.min.js +1 -1
  213. package/dist/x/first.js +1 -1
  214. package/dist/x/first.min.js +2 -2
  215. package/dist/x/first.mjs +1 -1
  216. package/dist/x/flatten.es.js +1 -1
  217. package/dist/x/flatten.es.min.js +2 -2
  218. package/dist/x/flatten.js +1 -1
  219. package/dist/x/flatten.min.js +2 -2
  220. package/dist/x/flatten.mjs +1 -1
  221. package/dist/x/groupBy.es.js +1 -1
  222. package/dist/x/groupBy.es.min.js +1 -1
  223. package/dist/x/groupBy.js +1 -1
  224. package/dist/x/groupBy.min.js +2 -2
  225. package/dist/x/groupBy.mjs +1 -1
  226. package/dist/x/has.es.js +1 -1
  227. package/dist/x/has.es.min.js +1 -1
  228. package/dist/x/has.js +1 -1
  229. package/dist/x/has.min.js +2 -2
  230. package/dist/x/has.mjs +1 -1
  231. package/dist/x/identity.es.js +1 -1
  232. package/dist/x/identity.es.min.js +1 -1
  233. package/dist/x/identity.js +1 -1
  234. package/dist/x/identity.min.js +2 -2
  235. package/dist/x/identity.mjs +1 -1
  236. package/dist/x/includes.es.js +1 -1
  237. package/dist/x/includes.es.min.js +1 -1
  238. package/dist/x/includes.js +1 -1
  239. package/dist/x/includes.min.js +2 -2
  240. package/dist/x/includes.mjs +1 -1
  241. package/dist/x/isDeepEqual.es.js +1 -1
  242. package/dist/x/isDeepEqual.es.min.js +1 -1
  243. package/dist/x/isDeepEqual.js +1 -1
  244. package/dist/x/isDeepEqual.min.js +2 -2
  245. package/dist/x/isDeepEqual.mjs +1 -1
  246. package/dist/x/isEmpty.es.js +1 -1
  247. package/dist/x/isEmpty.es.min.js +1 -1
  248. package/dist/x/isEmpty.js +1 -1
  249. package/dist/x/isEmpty.min.js +2 -2
  250. package/dist/x/isEmpty.mjs +1 -1
  251. package/dist/x/isEqual.es.js +1 -1
  252. package/dist/x/isEqual.es.min.js +1 -1
  253. package/dist/x/isEqual.js +1 -1
  254. package/dist/x/isEqual.min.js +2 -2
  255. package/dist/x/isEqual.mjs +1 -1
  256. package/dist/x/isFunction.es.js +1 -1
  257. package/dist/x/isFunction.es.min.js +1 -1
  258. package/dist/x/isFunction.js +1 -1
  259. package/dist/x/isFunction.min.js +2 -2
  260. package/dist/x/isFunction.mjs +1 -1
  261. package/dist/x/isIn.es.js +1 -1
  262. package/dist/x/isIn.es.min.js +1 -1
  263. package/dist/x/isIn.js +1 -1
  264. package/dist/x/isIn.min.js +2 -2
  265. package/dist/x/isIn.mjs +1 -1
  266. package/dist/x/isObject.es.js +1 -1
  267. package/dist/x/isObject.es.min.js +1 -1
  268. package/dist/x/isObject.js +1 -1
  269. package/dist/x/isObject.min.js +2 -2
  270. package/dist/x/isObject.mjs +1 -1
  271. package/dist/x/isString.es.js +1 -1
  272. package/dist/x/isString.es.min.js +1 -1
  273. package/dist/x/isString.js +1 -1
  274. package/dist/x/isString.min.js +2 -2
  275. package/dist/x/isString.mjs +1 -1
  276. package/dist/x/keys.es.js +1 -1
  277. package/dist/x/keys.es.min.js +1 -1
  278. package/dist/x/keys.js +1 -1
  279. package/dist/x/keys.min.js +2 -2
  280. package/dist/x/keys.mjs +1 -1
  281. package/dist/x/last.es.js +1 -1
  282. package/dist/x/last.es.min.js +1 -1
  283. package/dist/x/last.js +1 -1
  284. package/dist/x/last.min.js +2 -2
  285. package/dist/x/last.mjs +1 -1
  286. package/dist/x/maxBy.es.js +1 -1
  287. package/dist/x/maxBy.es.min.js +1 -1
  288. package/dist/x/maxBy.js +1 -1
  289. package/dist/x/maxBy.min.js +2 -2
  290. package/dist/x/maxBy.mjs +1 -1
  291. package/dist/x/noop.es.js +1 -1
  292. package/dist/x/noop.es.min.js +1 -1
  293. package/dist/x/noop.js +1 -1
  294. package/dist/x/noop.min.js +2 -2
  295. package/dist/x/noop.mjs +1 -1
  296. package/dist/x/pluck.es.js +13 -13
  297. package/dist/x/pluck.es.min.js +2 -2
  298. package/dist/x/pluck.js +13 -13
  299. package/dist/x/pluck.min.js +2 -2
  300. package/dist/x/pluck.mjs +13 -13
  301. package/dist/x/prepend.es.js +1 -1
  302. package/dist/x/prepend.es.min.js +1 -1
  303. package/dist/x/prepend.js +1 -1
  304. package/dist/x/prepend.min.js +2 -2
  305. package/dist/x/prepend.mjs +1 -1
  306. package/dist/x/size.es.js +1 -1
  307. package/dist/x/size.es.min.js +1 -1
  308. package/dist/x/size.js +1 -1
  309. package/dist/x/size.min.js +2 -2
  310. package/dist/x/size.mjs +1 -1
  311. package/dist/x/trace.es.js +1 -1
  312. package/dist/x/trace.es.min.js +1 -1
  313. package/dist/x/trace.js +1 -1
  314. package/dist/x/trace.min.js +2 -2
  315. package/dist/x/trace.mjs +1 -1
  316. package/dist/x/unionWith.es.js +1 -1
  317. package/dist/x/unionWith.es.min.js +1 -1
  318. package/dist/x/unionWith.js +1 -1
  319. package/dist/x/unionWith.min.js +2 -2
  320. package/dist/x/unionWith.mjs +1 -1
  321. package/dist/x/uniq.es.js +1 -1
  322. package/dist/x/uniq.es.min.js +1 -1
  323. package/dist/x/uniq.js +1 -1
  324. package/dist/x/uniq.min.js +2 -2
  325. package/dist/x/uniq.mjs +1 -1
  326. package/dist/x/unless.es.js +1 -1
  327. package/dist/x/unless.es.min.js +1 -1
  328. package/dist/x/unless.js +1 -1
  329. package/dist/x/unless.min.js +2 -2
  330. package/dist/x/unless.mjs +1 -1
  331. package/dist/x/values.es.js +1 -1
  332. package/dist/x/values.es.min.js +1 -1
  333. package/dist/x/values.js +1 -1
  334. package/dist/x/values.min.js +2 -2
  335. package/dist/x/values.mjs +1 -1
  336. package/dist/x/when.es.js +1 -1
  337. package/dist/x/when.es.min.js +1 -1
  338. package/dist/x/when.js +1 -1
  339. package/dist/x/when.min.js +2 -2
  340. package/dist/x/when.mjs +1 -1
  341. package/es.js +40 -36
  342. package/index.js +40 -36
  343. package/package.json +2 -1
package/dist/rubico.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1062,7 +1062,7 @@ const objectMapPool = function (o, concurrency, f) {
1062
1062
  return result
1063
1063
  }
1064
1064
 
1065
- const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
1065
+ const _curryArity = (arity, func, context, args) => function curried(...curriedArgs) {
1066
1066
  const argsLength = args.length,
1067
1067
  curriedArgsLength = curriedArgs.length,
1068
1068
  nextArgs = []
@@ -1083,8 +1083,8 @@ const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
1083
1083
  }
1084
1084
  if (nextArgs.length == arity) {
1085
1085
  return numCurriedPlaceholders == 0
1086
- ? func(...nextArgs)
1087
- : curryArity(arity, func, nextArgs)
1086
+ ? func.apply(context, nextArgs)
1087
+ : curryArity(arity, func, context, nextArgs)
1088
1088
  }
1089
1089
  }
1090
1090
 
@@ -1096,26 +1096,26 @@ const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
1096
1096
  nextArgs.push(curriedArg)
1097
1097
  if (nextArgs.length == arity) {
1098
1098
  return numCurriedPlaceholders == 0
1099
- ? func(...nextArgs)
1100
- : curryArity(arity, func, nextArgs)
1099
+ ? func.apply(context, nextArgs)
1100
+ : curryArity(arity, func, context, nextArgs)
1101
1101
  }
1102
1102
  }
1103
- return curryArity(arity, func, nextArgs)
1103
+ return curryArity(arity, func, context, nextArgs)
1104
1104
  }
1105
1105
 
1106
- const curryArity = function (arity, func, args) {
1106
+ const curryArity = function (arity, func, context, args) {
1107
1107
  const argsLength = args.length
1108
1108
  if (argsLength < arity) {
1109
- return _curryArity(arity, func, args)
1109
+ return _curryArity(arity, func, context, args)
1110
1110
  }
1111
1111
  let argsIndex = -1
1112
1112
  while (++argsIndex < argsLength) {
1113
1113
  const arg = args[argsIndex]
1114
1114
  if (arg == __) {
1115
- return _curryArity(arity, func, args)
1115
+ return _curryArity(arity, func, context, args)
1116
1116
  }
1117
1117
  }
1118
- return func(...args)
1118
+ return func.apply(context, args)
1119
1119
  }
1120
1120
 
1121
1121
  const spread2 = func => function spreading2([arg0, arg1]) {
@@ -1130,7 +1130,7 @@ const objectMapEntries = function (object, mapper) {
1130
1130
  mapping = mapper([key, value])
1131
1131
  if (isPromise(mapping)) {
1132
1132
  promises.push(mapping.then(
1133
- spread2(curryArity(3, objectSet, [result]))))
1133
+ spread2(curryArity(3, objectSet, this, [result]))))
1134
1134
  } else {
1135
1135
  result[mapping[0]] = mapping[1]
1136
1136
  }
@@ -1146,7 +1146,7 @@ const mapMapEntriesForEachCallback = (
1146
1146
  ) => function callback(value, key) {
1147
1147
  const mapping = mapper([key, value])
1148
1148
  if (isPromise(mapping)) {
1149
- promises.push(mapping.then(spread2(curryArity(3, mapSet, [result]))))
1149
+ promises.push(mapping.then(spread2(curryArity(3, mapSet, this, [result]))))
1150
1150
  } else {
1151
1151
  result.set(mapping[0], mapping[1])
1152
1152
  }
@@ -2455,21 +2455,21 @@ const SelfReferencingPromise = function (basePromise) {
2455
2455
  }
2456
2456
 
2457
2457
  const asyncArraySome = async function (
2458
- array, predicate, index, promisesInFlight,
2458
+ array, predicate, index, promises,
2459
2459
  ) {
2460
2460
  const length = array.length
2461
2461
 
2462
2462
  while (++index < length) {
2463
2463
  const predication = predicate(array[index])
2464
2464
  if (isPromise(predication)) {
2465
- promisesInFlight.add(SelfReferencingPromise(predication))
2465
+ promises.add(SelfReferencingPromise(predication))
2466
2466
  } else if (predication) {
2467
2467
  return true
2468
2468
  }
2469
2469
  }
2470
- while (promisesInFlight.size > 0) {
2471
- const [predication, promise] = await promiseRace(promisesInFlight)
2472
- promisesInFlight.delete(promise)
2470
+ while (promises.size > 0) {
2471
+ const [predication, promise] = await promiseRace(promises)
2472
+ promises.delete(promise)
2473
2473
  if (predication) {
2474
2474
  return true
2475
2475
  }
@@ -2494,7 +2494,7 @@ const arraySome = function (array, predicate) {
2494
2494
  }
2495
2495
 
2496
2496
  const asyncIteratorSome = async function (
2497
- iterator, predicate, promisesInFlight, maxConcurrency = 20,
2497
+ iterator, predicate, promises, maxConcurrency = 20,
2498
2498
  ) {
2499
2499
  let iteration = iterator.next()
2500
2500
  if (isPromise(iteration)) {
@@ -2502,16 +2502,16 @@ const asyncIteratorSome = async function (
2502
2502
  }
2503
2503
 
2504
2504
  while (!iteration.done) {
2505
- if (promisesInFlight.size >= maxConcurrency) {
2506
- const [predication, promise] = await promiseRace(promisesInFlight)
2507
- promisesInFlight.delete(promise)
2505
+ if (promises.size >= maxConcurrency) {
2506
+ const [predication, promise] = await promiseRace(promises)
2507
+ promises.delete(promise)
2508
2508
  if (predication) {
2509
2509
  return true
2510
2510
  }
2511
2511
  }
2512
2512
  const predication = predicate(iteration.value)
2513
2513
  if (isPromise(predication)) {
2514
- promisesInFlight.add(SelfReferencingPromise(predication))
2514
+ promises.add(SelfReferencingPromise(predication))
2515
2515
  } else if (predication) {
2516
2516
  return true
2517
2517
  }
@@ -2520,9 +2520,9 @@ const asyncIteratorSome = async function (
2520
2520
  iteration = await iteration
2521
2521
  }
2522
2522
  }
2523
- while (promisesInFlight.size > 0) {
2524
- const [predication, promise] = await promiseRace(promisesInFlight)
2525
- promisesInFlight.delete(promise)
2523
+ while (promises.size > 0) {
2524
+ const [predication, promise] = await promiseRace(promises)
2525
+ promises.delete(promise)
2526
2526
  if (predication) {
2527
2527
  return true
2528
2528
  }
@@ -2621,13 +2621,13 @@ const iteratorEvery = function (iterator, predicate) {
2621
2621
  }
2622
2622
 
2623
2623
  const asyncIteratorEvery = async function (
2624
- asyncIterator, predicate, promisesInFlight, maxConcurrency = 20,
2624
+ asyncIterator, predicate, promises, maxConcurrency = 20,
2625
2625
  ) {
2626
2626
  let iteration = await asyncIterator.next()
2627
2627
  while (!iteration.done) {
2628
- if (promisesInFlight.size >= maxConcurrency) {
2629
- const [predication, promise] = await promiseRace(promisesInFlight)
2630
- promisesInFlight.delete(promise)
2628
+ if (promises.size >= maxConcurrency) {
2629
+ const [predication, promise] = await promiseRace(promises)
2630
+ promises.delete(promise)
2631
2631
  if (!predication) {
2632
2632
  return false
2633
2633
  }
@@ -2635,15 +2635,15 @@ const asyncIteratorEvery = async function (
2635
2635
 
2636
2636
  const predication = predicate(iteration.value)
2637
2637
  if (isPromise(predication)) {
2638
- promisesInFlight.add(SelfReferencingPromise(predication))
2638
+ promises.add(SelfReferencingPromise(predication))
2639
2639
  } else if (!predication) {
2640
2640
  return false
2641
2641
  }
2642
2642
  iteration = await asyncIterator.next()
2643
2643
  }
2644
- while (promisesInFlight.size > 0) {
2645
- const [predication, promise] = await promiseRace(promisesInFlight)
2646
- promisesInFlight.delete(promise)
2644
+ while (promises.size > 0) {
2645
+ const [predication, promise] = await promiseRace(promises)
2646
+ promises.delete(promise)
2647
2647
  if (!predication) {
2648
2648
  return false
2649
2649
  }
@@ -3285,10 +3285,14 @@ const thunkify = (func, ...args) => function thunk() {
3285
3285
  return func(...args)
3286
3286
  }
3287
3287
 
3288
- const curry = (func, ...args) => curryArity(func.length, func, args)
3288
+ const curry = (func, ...args) => curryArity(func.length, func, this, args)
3289
3289
 
3290
3290
  curry.arity = function curryArity_(arity, func, ...args) {
3291
- return curryArity(arity, func, args)
3291
+ return curryArity(arity, func, this, args)
3292
+ }
3293
+
3294
+ curry.call = function call(func, context, ...args) {
3295
+ return curryArity(func.length, func, context, args)
3292
3296
  }
3293
3297
 
3294
3298
  const rubico = {
package/dist/set.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/set.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/set.min.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
6
6
  */
7
7
 
8
- !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((()=>t)):n.set=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=Array.isArray,e=/[.|[|\]]+/,o=function(n,t){const e=new Map,o=function(o){if(e.has(o))return e.get(o);const r=n(o);return e.set(o,r),e.size>t&&e.clear(),r};return o.cache=e,o}((function(n){const t=n.length-1,o="["==n[0],r="]"==n[t];return o&&r?n.slice(1,t).split(e):o?n.slice(1).split(e):r?n.slice(0,t).split(e):n.split(e)}),500),r=function(n,e,r){if(!(n=>{if(null==n)return!1;const t=typeof n;return"object"==t||"function"==t})(n))return n;const i=(n=>t(n)?n:"string"==typeof n?o(n):[n])(r),u=i.length,c=u-1,f={...n};let s=f,l=-1;for(;++l<u;){const n=i[l];if(l==c)s[n]=e;else{const e=s[n],o=t(e)?e.slice():{...e};s[n]=o,s=o}}return f},i=Symbol.for("placeholder"),u=function(n,t,e,o){return t==i?((n,t,e)=>function(o){return n(o,t,e)})(n,e,o):e==i?((n,t,e)=>function(o){return n(t,o,e)})(n,t,o):((n,t,e)=>function(o){return n(t,e,o)})(n,t,e)},c=function(t,e,o){if("function"==typeof o){const c=o(t);return n(c)?c.then(u(r,t,i,e)):r(t,c,e)}return n(o)?o.then(u(r,t,i,e)):r(t,o,e)};return function(t,e,o){return null==o?u(c,i,t,e):n(t)?t.then(u(c,i,e,o)):c(t,e,o)}}());
8
+ !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define(()=>t):n.set=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=Array.isArray,e=/[.|[|\]]+/,o=function(n,t){const e=new Map,o=function(o){if(e.has(o))return e.get(o);const r=n(o);return e.set(o,r),e.size>t&&e.clear(),r};return o.cache=e,o}(function(n){const t=n.length-1,o="["==n[0],r="]"==n[t];return o&&r?n.slice(1,t).split(e):o?n.slice(1).split(e):r?n.slice(0,t).split(e):n.split(e)},500),r=function(n,e,r){if(!(n=>{if(null==n)return!1;const t=typeof n;return"object"==t||"function"==t})(n))return n;const i=(n=>t(n)?n:"string"==typeof n?o(n):[n])(r),u=i.length,c=u-1,f={...n};let s=f,l=-1;for(;++l<u;){const n=i[l];if(l==c)s[n]=e;else{const e=s[n],o=t(e)?e.slice():{...e};s[n]=o,s=o}}return f},i=Symbol.for("placeholder"),u=function(n,t,e,o){return t==i?((n,t,e)=>function(o){return n(o,t,e)})(n,e,o):e==i?((n,t,e)=>function(o){return n(t,o,e)})(n,t,o):((n,t,e)=>function(o){return n(t,e,o)})(n,t,e)},c=function(t,e,o){if("function"==typeof o){const c=o(t);return n(c)?c.then(u(r,t,i,e)):r(t,c,e)}return n(o)?o.then(u(r,t,i,e)):r(t,o,e)};return function(t,e,o){return null==o?u(c,i,t,e):n(t)?t.then(u(c,i,e,o)):c(t,e,o)}}());
package/dist/set.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/some.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -41,21 +41,21 @@ const SelfReferencingPromise = function (basePromise) {
41
41
  const promiseRace = Promise.race.bind(Promise)
42
42
 
43
43
  const asyncArraySome = async function (
44
- array, predicate, index, promisesInFlight,
44
+ array, predicate, index, promises,
45
45
  ) {
46
46
  const length = array.length
47
47
 
48
48
  while (++index < length) {
49
49
  const predication = predicate(array[index])
50
50
  if (isPromise(predication)) {
51
- promisesInFlight.add(SelfReferencingPromise(predication))
51
+ promises.add(SelfReferencingPromise(predication))
52
52
  } else if (predication) {
53
53
  return true
54
54
  }
55
55
  }
56
- while (promisesInFlight.size > 0) {
57
- const [predication, promise] = await promiseRace(promisesInFlight)
58
- promisesInFlight.delete(promise)
56
+ while (promises.size > 0) {
57
+ const [predication, promise] = await promiseRace(promises)
58
+ promises.delete(promise)
59
59
  if (predication) {
60
60
  return true
61
61
  }
@@ -80,7 +80,7 @@ const arraySome = function (array, predicate) {
80
80
  }
81
81
 
82
82
  const asyncIteratorSome = async function (
83
- iterator, predicate, promisesInFlight, maxConcurrency = 20,
83
+ iterator, predicate, promises, maxConcurrency = 20,
84
84
  ) {
85
85
  let iteration = iterator.next()
86
86
  if (isPromise(iteration)) {
@@ -88,16 +88,16 @@ const asyncIteratorSome = async function (
88
88
  }
89
89
 
90
90
  while (!iteration.done) {
91
- if (promisesInFlight.size >= maxConcurrency) {
92
- const [predication, promise] = await promiseRace(promisesInFlight)
93
- promisesInFlight.delete(promise)
91
+ if (promises.size >= maxConcurrency) {
92
+ const [predication, promise] = await promiseRace(promises)
93
+ promises.delete(promise)
94
94
  if (predication) {
95
95
  return true
96
96
  }
97
97
  }
98
98
  const predication = predicate(iteration.value)
99
99
  if (isPromise(predication)) {
100
- promisesInFlight.add(SelfReferencingPromise(predication))
100
+ promises.add(SelfReferencingPromise(predication))
101
101
  } else if (predication) {
102
102
  return true
103
103
  }
@@ -106,9 +106,9 @@ const asyncIteratorSome = async function (
106
106
  iteration = await iteration
107
107
  }
108
108
  }
109
- while (promisesInFlight.size > 0) {
110
- const [predication, promise] = await promiseRace(promisesInFlight)
111
- promisesInFlight.delete(promise)
109
+ while (promises.size > 0) {
110
+ const [predication, promise] = await promiseRace(promises)
111
+ promises.delete(promise)
112
112
  if (predication) {
113
113
  return true
114
114
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
6
6
  */
7
- const isPromise=e=>null!=e&&"function"==typeof e.then,__=Symbol.for("placeholder"),curry2ResolveArg0=(e,r)=>function(o){return e(o,r)},curry2ResolveArg1=(e,r)=>function(o){return e(r,o)},curry2=function(e,r,o){return r==__?curry2ResolveArg0(e,o):curry2ResolveArg1(e,r)},isArray=Array.isArray,objectValues=Object.values,SelfReferencingPromise=function(e){const r=e.then((e=>[e,r]));return r},promiseRace=Promise.race.bind(Promise),asyncArraySome=async function(e,r,o,t){const n=e.length;for(;++o<n;){const n=r(e[o]);if(isPromise(n))t.add(SelfReferencingPromise(n));else if(n)return!0}for(;t.size>0;){const[e,r]=await promiseRace(t);if(t.delete(r),e)return!0}return!1},arraySome=function(e,r){const o=e.length;let t=-1;for(;++t<o;){const o=r(e[t]);if(isPromise(o))return asyncArraySome(e,r,t,new Set([SelfReferencingPromise(o)]));if(o)return!0}return!1},asyncIteratorSome=async function(e,r,o,t=20){let n=e.next();for(isPromise(n)&&(n=await n);!n.done;){if(o.size>=t){const[e,r]=await promiseRace(o);if(o.delete(r),e)return!0}const s=r(n.value);if(isPromise(s))o.add(SelfReferencingPromise(s));else if(s)return!0;n=e.next(),isPromise(n)&&(n=await n)}for(;o.size>0;){const[e,r]=await promiseRace(o);if(o.delete(r),e)return!0}return!1},iteratorSome=function(e,r){for(const o of e){const t=r(o);if(isPromise(t))return asyncIteratorSome(e,r,new Set([SelfReferencingPromise(t)]));if(t)return!0}return!1},reducerAnySync=e=>function(r,o){return!!r||e(o)},reducerSome=e=>function(r,o){return!0===r?r:isPromise(r)?r.then(curry2(reducerAnySync(e),__,o)):!!r||e(o)},symbolIterator=Symbol.iterator,symbolAsyncIterator=Symbol.asyncIterator,_some=function(e,r){return isArray(e)?arraySome(e,r):null==e?r(e):"function"==typeof e[symbolIterator]?iteratorSome(e[symbolIterator](),r):"function"==typeof e[symbolAsyncIterator]?asyncIteratorSome(e[symbolAsyncIterator](),r,new Set):"function"==typeof e.reduce?e.reduce(reducerSome(r),!1):e.constructor==Object?arraySome(objectValues(e),r):r(e)},some=function(e,r){return"function"==typeof e?curry2(_some,__,e):isPromise(e)?e.then(curry2(_some,__,r)):_some(e,r)};export default some;
7
+ const isPromise=e=>null!=e&&"function"==typeof e.then,__=Symbol.for("placeholder"),curry2ResolveArg0=(e,r)=>function(o){return e(o,r)},curry2ResolveArg1=(e,r)=>function(o){return e(r,o)},curry2=function(e,r,o){return r==__?curry2ResolveArg0(e,o):curry2ResolveArg1(e,r)},isArray=Array.isArray,objectValues=Object.values,SelfReferencingPromise=function(e){const r=e.then(e=>[e,r]);return r},promiseRace=Promise.race.bind(Promise),asyncArraySome=async function(e,r,o,t){const n=e.length;for(;++o<n;){const n=r(e[o]);if(isPromise(n))t.add(SelfReferencingPromise(n));else if(n)return!0}for(;t.size>0;){const[e,r]=await promiseRace(t);if(t.delete(r),e)return!0}return!1},arraySome=function(e,r){const o=e.length;let t=-1;for(;++t<o;){const o=r(e[t]);if(isPromise(o))return asyncArraySome(e,r,t,new Set([SelfReferencingPromise(o)]));if(o)return!0}return!1},asyncIteratorSome=async function(e,r,o,t=20){let n=e.next();for(isPromise(n)&&(n=await n);!n.done;){if(o.size>=t){const[e,r]=await promiseRace(o);if(o.delete(r),e)return!0}const s=r(n.value);if(isPromise(s))o.add(SelfReferencingPromise(s));else if(s)return!0;n=e.next(),isPromise(n)&&(n=await n)}for(;o.size>0;){const[e,r]=await promiseRace(o);if(o.delete(r),e)return!0}return!1},iteratorSome=function(e,r){for(const o of e){const t=r(o);if(isPromise(t))return asyncIteratorSome(e,r,new Set([SelfReferencingPromise(t)]));if(t)return!0}return!1},reducerAnySync=e=>function(r,o){return!!r||e(o)},reducerSome=e=>function(r,o){return!0===r?r:isPromise(r)?r.then(curry2(reducerAnySync(e),__,o)):!!r||e(o)},symbolIterator=Symbol.iterator,symbolAsyncIterator=Symbol.asyncIterator,_some=function(e,r){return isArray(e)?arraySome(e,r):null==e?r(e):"function"==typeof e[symbolIterator]?iteratorSome(e[symbolIterator](),r):"function"==typeof e[symbolAsyncIterator]?asyncIteratorSome(e[symbolAsyncIterator](),r,new Set):"function"==typeof e.reduce?e.reduce(reducerSome(r),!1):e.constructor==Object?arraySome(objectValues(e),r):r(e)},some=function(e,r){return"function"==typeof e?curry2(_some,__,e):isPromise(e)?e.then(curry2(_some,__,r)):_some(e,r)};export default some;
package/dist/some.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -47,21 +47,21 @@ const SelfReferencingPromise = function (basePromise) {
47
47
  const promiseRace = Promise.race.bind(Promise)
48
48
 
49
49
  const asyncArraySome = async function (
50
- array, predicate, index, promisesInFlight,
50
+ array, predicate, index, promises,
51
51
  ) {
52
52
  const length = array.length
53
53
 
54
54
  while (++index < length) {
55
55
  const predication = predicate(array[index])
56
56
  if (isPromise(predication)) {
57
- promisesInFlight.add(SelfReferencingPromise(predication))
57
+ promises.add(SelfReferencingPromise(predication))
58
58
  } else if (predication) {
59
59
  return true
60
60
  }
61
61
  }
62
- while (promisesInFlight.size > 0) {
63
- const [predication, promise] = await promiseRace(promisesInFlight)
64
- promisesInFlight.delete(promise)
62
+ while (promises.size > 0) {
63
+ const [predication, promise] = await promiseRace(promises)
64
+ promises.delete(promise)
65
65
  if (predication) {
66
66
  return true
67
67
  }
@@ -86,7 +86,7 @@ const arraySome = function (array, predicate) {
86
86
  }
87
87
 
88
88
  const asyncIteratorSome = async function (
89
- iterator, predicate, promisesInFlight, maxConcurrency = 20,
89
+ iterator, predicate, promises, maxConcurrency = 20,
90
90
  ) {
91
91
  let iteration = iterator.next()
92
92
  if (isPromise(iteration)) {
@@ -94,16 +94,16 @@ const asyncIteratorSome = async function (
94
94
  }
95
95
 
96
96
  while (!iteration.done) {
97
- if (promisesInFlight.size >= maxConcurrency) {
98
- const [predication, promise] = await promiseRace(promisesInFlight)
99
- promisesInFlight.delete(promise)
97
+ if (promises.size >= maxConcurrency) {
98
+ const [predication, promise] = await promiseRace(promises)
99
+ promises.delete(promise)
100
100
  if (predication) {
101
101
  return true
102
102
  }
103
103
  }
104
104
  const predication = predicate(iteration.value)
105
105
  if (isPromise(predication)) {
106
- promisesInFlight.add(SelfReferencingPromise(predication))
106
+ promises.add(SelfReferencingPromise(predication))
107
107
  } else if (predication) {
108
108
  return true
109
109
  }
@@ -112,9 +112,9 @@ const asyncIteratorSome = async function (
112
112
  iteration = await iteration
113
113
  }
114
114
  }
115
- while (promisesInFlight.size > 0) {
116
- const [predication, promise] = await promiseRace(promisesInFlight)
117
- promisesInFlight.delete(promise)
115
+ while (promises.size > 0) {
116
+ const [predication, promise] = await promiseRace(promises)
117
+ promises.delete(promise)
118
118
  if (predication) {
119
119
  return true
120
120
  }
package/dist/some.min.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
6
6
  */
7
7
 
8
- !function(t,n){"object"==typeof module?module.exports=n:"function"==typeof define?define((()=>n)):t.some=n}("object"==typeof globalThis?globalThis:this,function(){"use strict";const t=t=>null!=t&&"function"==typeof t.then,n=Symbol.for("placeholder"),e=function(t,e,r){return e==n?((t,n)=>function(e){return t(e,n)})(t,r):((t,n)=>function(e){return t(n,e)})(t,e)},r=Array.isArray,o=Object.values,u=function(t){const n=t.then((t=>[t,n]));return n},i=Promise.race.bind(Promise),f=async function(n,e,r,o){const f=n.length;for(;++r<f;){const i=e(n[r]);if(t(i))o.add(u(i));else if(i)return!0}for(;o.size>0;){const[t,n]=await i(o);if(o.delete(n),t)return!0}return!1},c=function(n,e){const r=n.length;let o=-1;for(;++o<r;){const r=e(n[o]);if(t(r))return f(n,e,o,new Set([u(r)]));if(r)return!0}return!1},s=async function(n,e,r,o=20){let f=n.next();for(t(f)&&(f=await f);!f.done;){if(r.size>=o){const[t,n]=await i(r);if(r.delete(n),t)return!0}const c=e(f.value);if(t(c))r.add(u(c));else if(c)return!0;f=n.next(),t(f)&&(f=await f)}for(;r.size>0;){const[t,n]=await i(r);if(r.delete(n),t)return!0}return!1},l=Symbol.iterator,a=Symbol.asyncIterator,d=function(i,f){return r(i)?c(i,f):null==i?f(i):"function"==typeof i[l]?function(n,e){for(const r of n){const o=e(r);if(t(o))return s(n,e,new Set([u(o)]));if(o)return!0}return!1}(i[l](),f):"function"==typeof i[a]?s(i[a](),f,new Set):"function"==typeof i.reduce?i.reduce((r=>function(o,u){return!0===o?o:t(o)?o.then(e((t=>function(n,e){return!!n||t(e)})(r),n,u)):!!o||r(u)})(f),!1):i.constructor==Object?c(o(i),f):f(i)};return function(r,o){return"function"==typeof r?e(d,n,r):t(r)?r.then(e(d,n,o)):d(r,o)}}());
8
+ !function(t,n){"object"==typeof module?module.exports=n:"function"==typeof define?define(()=>n):t.some=n}("object"==typeof globalThis?globalThis:this,function(){"use strict";const t=t=>null!=t&&"function"==typeof t.then,n=Symbol.for("placeholder"),e=function(t,e,r){return e==n?((t,n)=>function(e){return t(e,n)})(t,r):((t,n)=>function(e){return t(n,e)})(t,e)},r=Array.isArray,o=Object.values,u=function(t){const n=t.then(t=>[t,n]);return n},i=Promise.race.bind(Promise),f=async function(n,e,r,o){const f=n.length;for(;++r<f;){const i=e(n[r]);if(t(i))o.add(u(i));else if(i)return!0}for(;o.size>0;){const[t,n]=await i(o);if(o.delete(n),t)return!0}return!1},c=function(n,e){const r=n.length;let o=-1;for(;++o<r;){const r=e(n[o]);if(t(r))return f(n,e,o,new Set([u(r)]));if(r)return!0}return!1},s=async function(n,e,r,o=20){let f=n.next();for(t(f)&&(f=await f);!f.done;){if(r.size>=o){const[t,n]=await i(r);if(r.delete(n),t)return!0}const c=e(f.value);if(t(c))r.add(u(c));else if(c)return!0;f=n.next(),t(f)&&(f=await f)}for(;r.size>0;){const[t,n]=await i(r);if(r.delete(n),t)return!0}return!1},l=Symbol.iterator,a=Symbol.asyncIterator,d=function(i,f){return r(i)?c(i,f):null==i?f(i):"function"==typeof i[l]?function(n,e){for(const r of n){const o=e(r);if(t(o))return s(n,e,new Set([u(o)]));if(o)return!0}return!1}(i[l](),f):"function"==typeof i[a]?s(i[a](),f,new Set):"function"==typeof i.reduce?i.reduce((r=>function(o,u){return!0===o?o:t(o)?o.then(e((t=>function(n,e){return!!n||t(e)})(r),n,u)):!!o||r(u)})(f),!1):i.constructor==Object?c(o(i),f):f(i)};return function(r,o){return"function"==typeof r?e(d,n,r):t(r)?r.then(e(d,n,o)):d(r,o)}}());
package/dist/some.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -41,21 +41,21 @@ const SelfReferencingPromise = function (basePromise) {
41
41
  const promiseRace = Promise.race.bind(Promise)
42
42
 
43
43
  const asyncArraySome = async function (
44
- array, predicate, index, promisesInFlight,
44
+ array, predicate, index, promises,
45
45
  ) {
46
46
  const length = array.length
47
47
 
48
48
  while (++index < length) {
49
49
  const predication = predicate(array[index])
50
50
  if (isPromise(predication)) {
51
- promisesInFlight.add(SelfReferencingPromise(predication))
51
+ promises.add(SelfReferencingPromise(predication))
52
52
  } else if (predication) {
53
53
  return true
54
54
  }
55
55
  }
56
- while (promisesInFlight.size > 0) {
57
- const [predication, promise] = await promiseRace(promisesInFlight)
58
- promisesInFlight.delete(promise)
56
+ while (promises.size > 0) {
57
+ const [predication, promise] = await promiseRace(promises)
58
+ promises.delete(promise)
59
59
  if (predication) {
60
60
  return true
61
61
  }
@@ -80,7 +80,7 @@ const arraySome = function (array, predicate) {
80
80
  }
81
81
 
82
82
  const asyncIteratorSome = async function (
83
- iterator, predicate, promisesInFlight, maxConcurrency = 20,
83
+ iterator, predicate, promises, maxConcurrency = 20,
84
84
  ) {
85
85
  let iteration = iterator.next()
86
86
  if (isPromise(iteration)) {
@@ -88,16 +88,16 @@ const asyncIteratorSome = async function (
88
88
  }
89
89
 
90
90
  while (!iteration.done) {
91
- if (promisesInFlight.size >= maxConcurrency) {
92
- const [predication, promise] = await promiseRace(promisesInFlight)
93
- promisesInFlight.delete(promise)
91
+ if (promises.size >= maxConcurrency) {
92
+ const [predication, promise] = await promiseRace(promises)
93
+ promises.delete(promise)
94
94
  if (predication) {
95
95
  return true
96
96
  }
97
97
  }
98
98
  const predication = predicate(iteration.value)
99
99
  if (isPromise(predication)) {
100
- promisesInFlight.add(SelfReferencingPromise(predication))
100
+ promises.add(SelfReferencingPromise(predication))
101
101
  } else if (predication) {
102
102
  return true
103
103
  }
@@ -106,9 +106,9 @@ const asyncIteratorSome = async function (
106
106
  iteration = await iteration
107
107
  }
108
108
  }
109
- while (promisesInFlight.size > 0) {
110
- const [predication, promise] = await promiseRace(promisesInFlight)
111
- promisesInFlight.delete(promise)
109
+ while (promises.size > 0) {
110
+ const [predication, promise] = await promiseRace(promises)
111
+ promises.delete(promise)
112
112
  if (predication) {
113
113
  return true
114
114
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,8 +1,8 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
6
6
  */
7
7
 
8
- !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((()=>t)):n.switchCase=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=Promise.all.bind(Promise),t=Array.isArray,r=n=>null!=n&&"function"==typeof n.then,o=(n,t,r)=>n?t():r(),e=(n,t)=>function(){return n(...t)},u=(n,t,r,o)=>function(){return n(t,r,o)},f=Symbol.for("placeholder"),i=function(n,t,r,o){return t==f?((n,t,r)=>function(o){return n(o,t,r)})(n,r,o):r==f?((n,t,r)=>function(o){return n(t,o,r)})(n,t,o):((n,t,r)=>function(o){return n(t,r,o)})(n,t,r)},c=n=>function(){return n},s=function(n,t,l){const h=n.length-1;for(;(l+=2)<h;){const h=n[l],p=n[l+1],y="function"==typeof h?h(...t):h;if(r(y))return y.then(i(o,f,"function"==typeof p?e(p,t):c(p),u(s,n,t,l)));if(y)return"function"==typeof p?p(...t):p}if(l==n.length)return;const p=n[h];return"function"==typeof p?p(...t):p},l=(n,t,r)=>function(){return n(t,r)},h=function(n,t){const e=n.length,u=e-1;for(;(t+=2)<u;){const e=n[t],u=n[t+1];if(r(e))return e.then(i(o,f,c(u),l(h,n,t)));if(e)return u}if(t!=e)return n[t]};return(...o)=>{const e=o.pop();return function(n){if(t(n)){const t=n.length;let r=-1;for(;++r<t;)if("function"==typeof n[r])return!1;return!0}for(const t in n)if("function"==typeof n[t])return!1;return!0}(e)?h(e,-2):0==o.length?(u=s,l=f,p=-2,(c=e)==f?((n,t,r)=>function(...o){return n(o,t,r)})(u,l,p):l==f?((n,t,r)=>function(...o){return n(t,o,r)})(u,c,p):((n,t,r)=>function(...o){return n(t,r,o)})(u,c,l)):function(n){if(t(n)){const t=n.length;let o=-1;for(;++o<t;){const t=n[o];if(r(t))return!0}return!1}for(const t in n){const o=n[t];if(r(o))return!0}return!1}(o)?n(o).then(i(s,e,f,-2)):s(e,o,-2);var u,c,l,p}}());
8
+ !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define(()=>t):n.switchCase=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=Promise.all.bind(Promise),t=Array.isArray,r=n=>null!=n&&"function"==typeof n.then,o=(n,t,r)=>n?t():r(),e=(n,t)=>function(){return n(...t)},u=(n,t,r,o)=>function(){return n(t,r,o)},f=Symbol.for("placeholder"),i=function(n,t,r,o){return t==f?((n,t,r)=>function(o){return n(o,t,r)})(n,r,o):r==f?((n,t,r)=>function(o){return n(t,o,r)})(n,t,o):((n,t,r)=>function(o){return n(t,r,o)})(n,t,r)},c=n=>function(){return n},s=function(n,t,l){const h=n.length-1;for(;(l+=2)<h;){const h=n[l],p=n[l+1],y="function"==typeof h?h(...t):h;if(r(y))return y.then(i(o,f,"function"==typeof p?e(p,t):c(p),u(s,n,t,l)));if(y)return"function"==typeof p?p(...t):p}if(l==n.length)return;const p=n[h];return"function"==typeof p?p(...t):p},l=(n,t,r)=>function(){return n(t,r)},h=function(n,t){const e=n.length,u=e-1;for(;(t+=2)<u;){const e=n[t],u=n[t+1];if(r(e))return e.then(i(o,f,c(u),l(h,n,t)));if(e)return u}if(t!=e)return n[t]};return(...o)=>{const e=o.pop();return function(n){if(t(n)){const t=n.length;let r=-1;for(;++r<t;)if("function"==typeof n[r])return!1;return!0}for(const t in n)if("function"==typeof n[t])return!1;return!0}(e)?h(e,-2):0==o.length?(u=s,l=f,p=-2,(c=e)==f?((n,t,r)=>function(...o){return n(o,t,r)})(u,l,p):l==f?((n,t,r)=>function(...o){return n(t,o,r)})(u,c,p):((n,t,r)=>function(...o){return n(t,r,o)})(u,c,l)):function(n){if(t(n)){const t=n.length;let o=-1;for(;++o<t;){const t=n[o];if(r(t))return!0}return!1}for(const t in n){const o=n[t];if(r(o))return!0}return!1}(o)?n(o).then(i(s,e,f,-2)):s(e,o,-2);var u,c,l,p}}());
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/tap.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/tap.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/tap.min.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
6
6
  */
7
7
 
8
- !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((()=>t)):n.tap=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=n=>function(){return n},r=(n,t,r)=>n?t():r(),e=Symbol.for("placeholder"),u=function(n,t,r,u){return t==e?((n,t,r)=>function(e){return n(e,t,r)})(n,r,u):r==e?((n,t,r)=>function(e){return n(t,e,r)})(n,t,u):((n,t,r)=>function(e){return n(t,r,e)})(n,t,r)},o=Array.isArray,i=function(t){if(o(t)){const r=t.length;let e=-1;for(;++e<r;){const r=t[e];if(n(r))return!0}return!1}for(const r in t){const e=t[r];if(n(e))return!0}return!1},f=Promise.all.bind(Promise),c=function(r,e){const u=r[0],o=e(...r);return n(o)?o.then(t(u)):u},s=function(...n){const t=n.pop();return 0==n.length?(r=c,o=t,(u=e)==e?((n,t)=>function(...r){return n(r,t)})(r,o):((n,t)=>function(...r){return n(t,r)})(r,u)):i(n)?f(n).then(function(n,t,r){return t==e?((n,t)=>function(r){return n(r,t)})(n,r):((n,t)=>function(r){return n(t,r)})(n,t)}(c,e,t)):c(n,t);var r,u,o},l=function(o,i,f){const c=o(...f);if(n(c))return c.then(u(r,e,((n,t)=>function(){return n(...t)})(s(i),f),t(f[0])));if(c){const r=i(...f);if(n(r))return r.then(t(f[0]))}return f[0]};return s.if=function(...n){if(2==n.length)return t=l,r=n[0],o=n[1],c=e,r==e?((n,t,r)=>function(...e){return n(e,t,r)})(t,o,c):o==e?((n,t,r)=>function(...e){return n(t,e,r)})(t,r,c):((n,t,r)=>function(...e){return n(t,r,e)})(t,r,o);var t,r,o,c;const s=n.length,h=n[s-1],a=n[s-2],p=n.slice(0,-2);return i(p)?f(p).then(u(l,a,h,e)):l(a,h,n)},s}());
8
+ !function(n,t){"object"==typeof module?module.exports=t:"function"==typeof define?define(()=>t):n.tap=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=n=>function(){return n},r=(n,t,r)=>n?t():r(),e=Symbol.for("placeholder"),u=function(n,t,r,u){return t==e?((n,t,r)=>function(e){return n(e,t,r)})(n,r,u):r==e?((n,t,r)=>function(e){return n(t,e,r)})(n,t,u):((n,t,r)=>function(e){return n(t,r,e)})(n,t,r)},o=Array.isArray,i=function(t){if(o(t)){const r=t.length;let e=-1;for(;++e<r;){const r=t[e];if(n(r))return!0}return!1}for(const r in t){const e=t[r];if(n(e))return!0}return!1},f=Promise.all.bind(Promise),c=function(r,e){const u=r[0],o=e(...r);return n(o)?o.then(t(u)):u},s=function(...n){const t=n.pop();return 0==n.length?(r=c,o=t,(u=e)==e?((n,t)=>function(...r){return n(r,t)})(r,o):((n,t)=>function(...r){return n(t,r)})(r,u)):i(n)?f(n).then(function(n,t,r){return t==e?((n,t)=>function(r){return n(r,t)})(n,r):((n,t)=>function(r){return n(t,r)})(n,t)}(c,e,t)):c(n,t);var r,u,o},l=function(o,i,f){const c=o(...f);if(n(c))return c.then(u(r,e,((n,t)=>function(){return n(...t)})(s(i),f),t(f[0])));if(c){const r=i(...f);if(n(r))return r.then(t(f[0]))}return f[0]};return s.if=function(...n){if(2==n.length)return t=l,r=n[0],o=n[1],c=e,r==e?((n,t,r)=>function(...e){return n(e,t,r)})(t,o,c):o==e?((n,t,r)=>function(...e){return n(t,e,r)})(t,r,c):((n,t,r)=>function(...e){return n(t,r,e)})(t,r,o);var t,r,o,c;const s=n.length,h=n[s-1],a=n[s-2],p=n.slice(0,-2);return i(p)?f(p).then(u(l,a,h,e)):l(a,h,n)},s}());
package/dist/tap.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.
package/dist/thunkify.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * rubico v2.7.9
2
+ * rubico v2.8.0
3
3
  * https://github.com/a-synchronous/rubico
4
4
  * (c) 2019-2026 Richard Tong
5
5
  * rubico may be freely distributed under the MIT license.