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.
- package/README.md +2 -2
- package/_internal/arraySome.js +6 -6
- package/_internal/asyncIteratorEvery.js +10 -10
- package/_internal/asyncIteratorSome.js +9 -9
- package/_internal/curryArity.js +14 -12
- package/_internal/mapMapEntries.js +1 -1
- package/_internal/objectMapEntries.js +1 -1
- package/curry.js +59 -3
- package/dist/Transducer.es.js +1 -1
- package/dist/Transducer.es.min.js +1 -1
- package/dist/Transducer.js +1 -1
- package/dist/Transducer.min.js +2 -2
- package/dist/Transducer.mjs +1 -1
- package/dist/__.es.js +1 -1
- package/dist/__.es.min.js +1 -1
- package/dist/__.js +1 -1
- package/dist/__.min.js +2 -2
- package/dist/__.mjs +1 -1
- package/dist/all.es.js +1 -1
- package/dist/all.es.min.js +1 -1
- package/dist/all.js +1 -1
- package/dist/all.min.js +2 -2
- package/dist/all.mjs +1 -1
- package/dist/always.es.js +1 -1
- package/dist/always.es.min.js +1 -1
- package/dist/always.js +1 -1
- package/dist/always.min.js +2 -2
- package/dist/always.mjs +1 -1
- package/dist/and.es.js +1 -1
- package/dist/and.es.min.js +1 -1
- package/dist/and.js +1 -1
- package/dist/and.min.js +2 -2
- package/dist/and.mjs +1 -1
- package/dist/assign.es.js +1 -1
- package/dist/assign.es.min.js +1 -1
- package/dist/assign.js +1 -1
- package/dist/assign.min.js +2 -2
- package/dist/assign.mjs +1 -1
- package/dist/compose.es.js +1 -1
- package/dist/compose.es.min.js +1 -1
- package/dist/compose.js +1 -1
- package/dist/compose.min.js +2 -2
- package/dist/compose.mjs +1 -1
- package/dist/curry.es.js +17 -13
- package/dist/curry.es.min.js +2 -2
- package/dist/curry.js +17 -13
- package/dist/curry.min.js +2 -2
- package/dist/curry.mjs +17 -13
- package/dist/eq.es.js +1 -1
- package/dist/eq.es.min.js +1 -1
- package/dist/eq.js +1 -1
- package/dist/eq.min.js +2 -2
- package/dist/eq.mjs +1 -1
- package/dist/every.es.js +9 -9
- package/dist/every.es.min.js +2 -2
- package/dist/every.js +9 -9
- package/dist/every.min.js +2 -2
- package/dist/every.mjs +9 -9
- package/dist/filter.es.js +1 -1
- package/dist/filter.es.min.js +1 -1
- package/dist/filter.js +1 -1
- package/dist/filter.min.js +2 -2
- package/dist/filter.mjs +1 -1
- package/dist/flatMap.es.js +1 -1
- package/dist/flatMap.es.min.js +2 -2
- package/dist/flatMap.js +1 -1
- package/dist/flatMap.min.js +2 -2
- package/dist/flatMap.mjs +1 -1
- package/dist/forEach.es.js +1 -1
- package/dist/forEach.es.min.js +1 -1
- package/dist/forEach.js +1 -1
- package/dist/forEach.min.js +2 -2
- package/dist/forEach.mjs +1 -1
- package/dist/get.es.js +1 -1
- package/dist/get.es.min.js +1 -1
- package/dist/get.js +1 -1
- package/dist/get.min.js +2 -2
- package/dist/get.mjs +1 -1
- package/dist/gt.es.js +1 -1
- package/dist/gt.es.min.js +1 -1
- package/dist/gt.js +1 -1
- package/dist/gt.min.js +2 -2
- package/dist/gt.mjs +1 -1
- package/dist/gte.es.js +1 -1
- package/dist/gte.es.min.js +1 -1
- package/dist/gte.js +1 -1
- package/dist/gte.min.js +2 -2
- package/dist/gte.mjs +1 -1
- package/dist/lt.es.js +1 -1
- package/dist/lt.es.min.js +1 -1
- package/dist/lt.js +1 -1
- package/dist/lt.min.js +2 -2
- package/dist/lt.mjs +1 -1
- package/dist/lte.es.js +1 -1
- package/dist/lte.es.min.js +1 -1
- package/dist/lte.js +1 -1
- package/dist/lte.min.js +2 -2
- package/dist/lte.mjs +1 -1
- package/dist/map.es.js +13 -13
- package/dist/map.es.min.js +2 -2
- package/dist/map.js +13 -13
- package/dist/map.min.js +2 -2
- package/dist/map.mjs +13 -13
- package/dist/not.es.js +1 -1
- package/dist/not.es.min.js +1 -1
- package/dist/not.js +1 -1
- package/dist/not.min.js +2 -2
- package/dist/not.mjs +1 -1
- package/dist/omit.es.js +1 -1
- package/dist/omit.es.min.js +1 -1
- package/dist/omit.js +1 -1
- package/dist/omit.min.js +2 -2
- package/dist/omit.mjs +1 -1
- package/dist/or.es.js +1 -1
- package/dist/or.es.min.js +1 -1
- package/dist/or.js +1 -1
- package/dist/or.min.js +2 -2
- package/dist/or.mjs +1 -1
- package/dist/pick.es.js +1 -1
- package/dist/pick.es.min.js +1 -1
- package/dist/pick.js +1 -1
- package/dist/pick.min.js +2 -2
- package/dist/pick.mjs +1 -1
- package/dist/pipe.es.js +1 -1
- package/dist/pipe.es.min.js +1 -1
- package/dist/pipe.js +1 -1
- package/dist/pipe.min.js +2 -2
- package/dist/pipe.mjs +1 -1
- package/dist/reduce.es.js +1 -1
- package/dist/reduce.es.min.js +1 -1
- package/dist/reduce.js +1 -1
- package/dist/reduce.min.js +2 -2
- package/dist/reduce.mjs +1 -1
- package/dist/rubico.es.js +40 -36
- package/dist/rubico.es.min.js +2 -2
- package/dist/rubico.global.js +40 -36
- package/dist/rubico.global.min.js +2 -2
- package/dist/rubico.js +40 -36
- package/dist/rubico.min.js +2 -2
- package/dist/rubico.mjs +40 -36
- package/dist/set.es.js +1 -1
- package/dist/set.es.min.js +1 -1
- package/dist/set.js +1 -1
- package/dist/set.min.js +2 -2
- package/dist/set.mjs +1 -1
- package/dist/some.es.js +14 -14
- package/dist/some.es.min.js +2 -2
- package/dist/some.js +14 -14
- package/dist/some.min.js +2 -2
- package/dist/some.mjs +14 -14
- package/dist/switchCase.es.js +1 -1
- package/dist/switchCase.es.min.js +1 -1
- package/dist/switchCase.js +1 -1
- package/dist/switchCase.min.js +2 -2
- package/dist/switchCase.mjs +1 -1
- package/dist/tap.es.js +1 -1
- package/dist/tap.es.min.js +1 -1
- package/dist/tap.js +1 -1
- package/dist/tap.min.js +2 -2
- package/dist/tap.mjs +1 -1
- package/dist/thunkify.es.js +1 -1
- package/dist/thunkify.es.min.js +1 -1
- package/dist/thunkify.js +1 -1
- package/dist/thunkify.min.js +2 -2
- package/dist/thunkify.mjs +1 -1
- package/dist/transform.es.js +1 -1
- package/dist/transform.es.min.js +1 -1
- package/dist/transform.js +1 -1
- package/dist/transform.min.js +2 -2
- package/dist/transform.mjs +1 -1
- package/dist/tryCatch.es.js +1 -1
- package/dist/tryCatch.es.min.js +1 -1
- package/dist/tryCatch.js +1 -1
- package/dist/tryCatch.min.js +2 -2
- package/dist/tryCatch.mjs +1 -1
- package/dist/x/append.es.js +1 -1
- package/dist/x/append.es.min.js +1 -1
- package/dist/x/append.js +1 -1
- package/dist/x/append.min.js +2 -2
- package/dist/x/append.mjs +1 -1
- package/dist/x/callProp.es.js +1 -1
- package/dist/x/callProp.es.min.js +1 -1
- package/dist/x/callProp.js +1 -1
- package/dist/x/callProp.min.js +2 -2
- package/dist/x/callProp.mjs +1 -1
- package/dist/x/defaultsDeep.es.js +1 -1
- package/dist/x/defaultsDeep.es.min.js +1 -1
- package/dist/x/defaultsDeep.js +1 -1
- package/dist/x/defaultsDeep.min.js +2 -2
- package/dist/x/defaultsDeep.mjs +1 -1
- package/dist/x/differenceWith.es.js +6 -6
- package/dist/x/differenceWith.es.min.js +2 -2
- package/dist/x/differenceWith.js +6 -6
- package/dist/x/differenceWith.min.js +2 -2
- package/dist/x/differenceWith.mjs +6 -6
- package/dist/x/filterOut.es.js +1 -1
- package/dist/x/filterOut.es.min.js +1 -1
- package/dist/x/filterOut.js +1 -1
- package/dist/x/filterOut.min.js +2 -2
- package/dist/x/filterOut.mjs +1 -1
- package/dist/x/find.es.js +1 -1
- package/dist/x/find.es.min.js +1 -1
- package/dist/x/find.js +1 -1
- package/dist/x/find.min.js +2 -2
- package/dist/x/find.mjs +1 -1
- package/dist/x/findIndex.es.js +1 -1
- package/dist/x/findIndex.es.min.js +1 -1
- package/dist/x/findIndex.js +1 -1
- package/dist/x/findIndex.min.js +2 -2
- package/dist/x/findIndex.mjs +1 -1
- package/dist/x/first.es.js +1 -1
- package/dist/x/first.es.min.js +1 -1
- package/dist/x/first.js +1 -1
- package/dist/x/first.min.js +2 -2
- package/dist/x/first.mjs +1 -1
- package/dist/x/flatten.es.js +1 -1
- package/dist/x/flatten.es.min.js +2 -2
- package/dist/x/flatten.js +1 -1
- package/dist/x/flatten.min.js +2 -2
- package/dist/x/flatten.mjs +1 -1
- package/dist/x/groupBy.es.js +1 -1
- package/dist/x/groupBy.es.min.js +1 -1
- package/dist/x/groupBy.js +1 -1
- package/dist/x/groupBy.min.js +2 -2
- package/dist/x/groupBy.mjs +1 -1
- package/dist/x/has.es.js +1 -1
- package/dist/x/has.es.min.js +1 -1
- package/dist/x/has.js +1 -1
- package/dist/x/has.min.js +2 -2
- package/dist/x/has.mjs +1 -1
- package/dist/x/identity.es.js +1 -1
- package/dist/x/identity.es.min.js +1 -1
- package/dist/x/identity.js +1 -1
- package/dist/x/identity.min.js +2 -2
- package/dist/x/identity.mjs +1 -1
- package/dist/x/includes.es.js +1 -1
- package/dist/x/includes.es.min.js +1 -1
- package/dist/x/includes.js +1 -1
- package/dist/x/includes.min.js +2 -2
- package/dist/x/includes.mjs +1 -1
- package/dist/x/isDeepEqual.es.js +1 -1
- package/dist/x/isDeepEqual.es.min.js +1 -1
- package/dist/x/isDeepEqual.js +1 -1
- package/dist/x/isDeepEqual.min.js +2 -2
- package/dist/x/isDeepEqual.mjs +1 -1
- package/dist/x/isEmpty.es.js +1 -1
- package/dist/x/isEmpty.es.min.js +1 -1
- package/dist/x/isEmpty.js +1 -1
- package/dist/x/isEmpty.min.js +2 -2
- package/dist/x/isEmpty.mjs +1 -1
- package/dist/x/isEqual.es.js +1 -1
- package/dist/x/isEqual.es.min.js +1 -1
- package/dist/x/isEqual.js +1 -1
- package/dist/x/isEqual.min.js +2 -2
- package/dist/x/isEqual.mjs +1 -1
- package/dist/x/isFunction.es.js +1 -1
- package/dist/x/isFunction.es.min.js +1 -1
- package/dist/x/isFunction.js +1 -1
- package/dist/x/isFunction.min.js +2 -2
- package/dist/x/isFunction.mjs +1 -1
- package/dist/x/isIn.es.js +1 -1
- package/dist/x/isIn.es.min.js +1 -1
- package/dist/x/isIn.js +1 -1
- package/dist/x/isIn.min.js +2 -2
- package/dist/x/isIn.mjs +1 -1
- package/dist/x/isObject.es.js +1 -1
- package/dist/x/isObject.es.min.js +1 -1
- package/dist/x/isObject.js +1 -1
- package/dist/x/isObject.min.js +2 -2
- package/dist/x/isObject.mjs +1 -1
- package/dist/x/isString.es.js +1 -1
- package/dist/x/isString.es.min.js +1 -1
- package/dist/x/isString.js +1 -1
- package/dist/x/isString.min.js +2 -2
- package/dist/x/isString.mjs +1 -1
- package/dist/x/keys.es.js +1 -1
- package/dist/x/keys.es.min.js +1 -1
- package/dist/x/keys.js +1 -1
- package/dist/x/keys.min.js +2 -2
- package/dist/x/keys.mjs +1 -1
- package/dist/x/last.es.js +1 -1
- package/dist/x/last.es.min.js +1 -1
- package/dist/x/last.js +1 -1
- package/dist/x/last.min.js +2 -2
- package/dist/x/last.mjs +1 -1
- package/dist/x/maxBy.es.js +1 -1
- package/dist/x/maxBy.es.min.js +1 -1
- package/dist/x/maxBy.js +1 -1
- package/dist/x/maxBy.min.js +2 -2
- package/dist/x/maxBy.mjs +1 -1
- package/dist/x/noop.es.js +1 -1
- package/dist/x/noop.es.min.js +1 -1
- package/dist/x/noop.js +1 -1
- package/dist/x/noop.min.js +2 -2
- package/dist/x/noop.mjs +1 -1
- package/dist/x/pluck.es.js +13 -13
- package/dist/x/pluck.es.min.js +2 -2
- package/dist/x/pluck.js +13 -13
- package/dist/x/pluck.min.js +2 -2
- package/dist/x/pluck.mjs +13 -13
- package/dist/x/prepend.es.js +1 -1
- package/dist/x/prepend.es.min.js +1 -1
- package/dist/x/prepend.js +1 -1
- package/dist/x/prepend.min.js +2 -2
- package/dist/x/prepend.mjs +1 -1
- package/dist/x/size.es.js +1 -1
- package/dist/x/size.es.min.js +1 -1
- package/dist/x/size.js +1 -1
- package/dist/x/size.min.js +2 -2
- package/dist/x/size.mjs +1 -1
- package/dist/x/trace.es.js +1 -1
- package/dist/x/trace.es.min.js +1 -1
- package/dist/x/trace.js +1 -1
- package/dist/x/trace.min.js +2 -2
- package/dist/x/trace.mjs +1 -1
- package/dist/x/unionWith.es.js +1 -1
- package/dist/x/unionWith.es.min.js +1 -1
- package/dist/x/unionWith.js +1 -1
- package/dist/x/unionWith.min.js +2 -2
- package/dist/x/unionWith.mjs +1 -1
- package/dist/x/uniq.es.js +1 -1
- package/dist/x/uniq.es.min.js +1 -1
- package/dist/x/uniq.js +1 -1
- package/dist/x/uniq.min.js +2 -2
- package/dist/x/uniq.mjs +1 -1
- package/dist/x/unless.es.js +1 -1
- package/dist/x/unless.es.min.js +1 -1
- package/dist/x/unless.js +1 -1
- package/dist/x/unless.min.js +2 -2
- package/dist/x/unless.mjs +1 -1
- package/dist/x/values.es.js +1 -1
- package/dist/x/values.es.min.js +1 -1
- package/dist/x/values.js +1 -1
- package/dist/x/values.min.js +2 -2
- package/dist/x/values.mjs +1 -1
- package/dist/x/when.es.js +1 -1
- package/dist/x/when.es.min.js +1 -1
- package/dist/x/when.js +1 -1
- package/dist/x/when.min.js +2 -2
- package/dist/x/when.mjs +1 -1
- package/es.js +40 -36
- package/index.js +40 -36
- package/package.json +2 -1
package/dist/rubico.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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(
|
|
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(
|
|
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(
|
|
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,
|
|
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
|
-
|
|
2465
|
+
promises.add(SelfReferencingPromise(predication))
|
|
2466
2466
|
} else if (predication) {
|
|
2467
2467
|
return true
|
|
2468
2468
|
}
|
|
2469
2469
|
}
|
|
2470
|
-
while (
|
|
2471
|
-
const [predication, promise] = await promiseRace(
|
|
2472
|
-
|
|
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,
|
|
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 (
|
|
2506
|
-
const [predication, promise] = await promiseRace(
|
|
2507
|
-
|
|
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
|
-
|
|
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 (
|
|
2524
|
-
const [predication, promise] = await promiseRace(
|
|
2525
|
-
|
|
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,
|
|
2624
|
+
asyncIterator, predicate, promises, maxConcurrency = 20,
|
|
2625
2625
|
) {
|
|
2626
2626
|
let iteration = await asyncIterator.next()
|
|
2627
2627
|
while (!iteration.done) {
|
|
2628
|
-
if (
|
|
2629
|
-
const [predication, promise] = await promiseRace(
|
|
2630
|
-
|
|
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
|
-
|
|
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 (
|
|
2645
|
-
const [predication, promise] = await promiseRace(
|
|
2646
|
-
|
|
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
package/dist/set.es.min.js
CHANGED
package/dist/set.js
CHANGED
package/dist/set.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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((
|
|
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
package/dist/some.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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,
|
|
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
|
-
|
|
51
|
+
promises.add(SelfReferencingPromise(predication))
|
|
52
52
|
} else if (predication) {
|
|
53
53
|
return true
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
while (
|
|
57
|
-
const [predication, promise] = await promiseRace(
|
|
58
|
-
|
|
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,
|
|
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 (
|
|
92
|
-
const [predication, promise] = await promiseRace(
|
|
93
|
-
|
|
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
|
-
|
|
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 (
|
|
110
|
-
const [predication, promise] = await promiseRace(
|
|
111
|
-
|
|
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
|
}
|
package/dist/some.es.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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(
|
|
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.
|
|
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,
|
|
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
|
-
|
|
57
|
+
promises.add(SelfReferencingPromise(predication))
|
|
58
58
|
} else if (predication) {
|
|
59
59
|
return true
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
while (
|
|
63
|
-
const [predication, promise] = await promiseRace(
|
|
64
|
-
|
|
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,
|
|
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 (
|
|
98
|
-
const [predication, promise] = await promiseRace(
|
|
99
|
-
|
|
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
|
-
|
|
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 (
|
|
116
|
-
const [predication, promise] = await promiseRace(
|
|
117
|
-
|
|
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.
|
|
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((
|
|
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.
|
|
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,
|
|
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
|
-
|
|
51
|
+
promises.add(SelfReferencingPromise(predication))
|
|
52
52
|
} else if (predication) {
|
|
53
53
|
return true
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
while (
|
|
57
|
-
const [predication, promise] = await promiseRace(
|
|
58
|
-
|
|
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,
|
|
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 (
|
|
92
|
-
const [predication, promise] = await promiseRace(
|
|
93
|
-
|
|
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
|
-
|
|
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 (
|
|
110
|
-
const [predication, promise] = await promiseRace(
|
|
111
|
-
|
|
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
|
}
|
package/dist/switchCase.es.js
CHANGED
package/dist/switchCase.js
CHANGED
package/dist/switchCase.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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((
|
|
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}}());
|
package/dist/switchCase.mjs
CHANGED
package/dist/tap.es.js
CHANGED
package/dist/tap.es.min.js
CHANGED
package/dist/tap.js
CHANGED
package/dist/tap.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* rubico v2.
|
|
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((
|
|
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
package/dist/thunkify.es.js
CHANGED
package/dist/thunkify.es.min.js
CHANGED
package/dist/thunkify.js
CHANGED