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/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# [
|
|
1
|
+
# [Rubico](https://rubico.land/)
|
|
2
2
|

|
|
3
3
|
> a shallow river in northeastern Italy, just south of Ravenna
|
|
4
4
|
|
|
@@ -247,7 +247,7 @@ Your feedback and contributions are welcome. If you have a suggestion, please ra
|
|
|
247
247
|
|
|
248
248
|
Pull requests should provide some basic context and link the relevant issue. Here is an [example pull request](https://github.com/a-synchronous/rubico/pull/12). If you are interested in contributing, the [help wanted](https://github.com/a-synchronous/rubico/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tag is a good place to start.
|
|
249
249
|
|
|
250
|
-
For more information please see [CONTRIBUTING.md](/CONTRIBUTING.md)
|
|
250
|
+
For more information please see [CONTRIBUTING.md](https://github.com/a-synchronous/rubico/blob/master/CONTRIBUTING.md)
|
|
251
251
|
|
|
252
252
|
## License
|
|
253
253
|
Rubico is [MIT Licensed](https://github.com/a-synchronous/rubico/blob/master/LICENSE).
|
package/_internal/arraySome.js
CHANGED
|
@@ -11,26 +11,26 @@ const promiseRace = require('./promiseRace')
|
|
|
11
11
|
* array Array,
|
|
12
12
|
* predicate any=>Promise|boolean,
|
|
13
13
|
* index number,
|
|
14
|
-
*
|
|
14
|
+
* promises Set<Promise>,
|
|
15
15
|
* ) -> boolean
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
const asyncArraySome = async function (
|
|
19
|
-
array, predicate, index,
|
|
19
|
+
array, predicate, index, promises,
|
|
20
20
|
) {
|
|
21
21
|
const length = array.length
|
|
22
22
|
|
|
23
23
|
while (++index < length) {
|
|
24
24
|
const predication = predicate(array[index])
|
|
25
25
|
if (isPromise(predication)) {
|
|
26
|
-
|
|
26
|
+
promises.add(SelfReferencingPromise(predication))
|
|
27
27
|
} else if (predication) {
|
|
28
28
|
return true
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
while (
|
|
32
|
-
const [predication, promise] = await promiseRace(
|
|
33
|
-
|
|
31
|
+
while (promises.size > 0) {
|
|
32
|
+
const [predication, promise] = await promiseRace(promises)
|
|
33
|
+
promises.delete(promise)
|
|
34
34
|
if (predication) {
|
|
35
35
|
return true
|
|
36
36
|
}
|
|
@@ -9,21 +9,21 @@ const promiseRace = require('./promiseRace')
|
|
|
9
9
|
* var T any,
|
|
10
10
|
* asyncIterator AsyncIterator<T>,
|
|
11
11
|
* predicate T=>Promise|boolean,
|
|
12
|
-
*
|
|
12
|
+
* promises Set<Promise<[T, Promise]>>,
|
|
13
13
|
* maxConcurrency number
|
|
14
14
|
*
|
|
15
15
|
* asyncIteratorEvery(
|
|
16
|
-
* asyncIterator, predicate,
|
|
16
|
+
* asyncIterator, predicate, promises, maxConcurrency,
|
|
17
17
|
* ) -> Promise<boolean>
|
|
18
18
|
*/
|
|
19
19
|
const asyncIteratorEvery = async function (
|
|
20
|
-
asyncIterator, predicate,
|
|
20
|
+
asyncIterator, predicate, promises, maxConcurrency = 20,
|
|
21
21
|
) {
|
|
22
22
|
let iteration = await asyncIterator.next()
|
|
23
23
|
while (!iteration.done) {
|
|
24
|
-
if (
|
|
25
|
-
const [predication, promise] = await promiseRace(
|
|
26
|
-
|
|
24
|
+
if (promises.size >= maxConcurrency) {
|
|
25
|
+
const [predication, promise] = await promiseRace(promises)
|
|
26
|
+
promises.delete(promise)
|
|
27
27
|
if (!predication) {
|
|
28
28
|
return false
|
|
29
29
|
}
|
|
@@ -31,15 +31,15 @@ const asyncIteratorEvery = async function (
|
|
|
31
31
|
|
|
32
32
|
const predication = predicate(iteration.value)
|
|
33
33
|
if (isPromise(predication)) {
|
|
34
|
-
|
|
34
|
+
promises.add(SelfReferencingPromise(predication))
|
|
35
35
|
} else if (!predication) {
|
|
36
36
|
return false
|
|
37
37
|
}
|
|
38
38
|
iteration = await asyncIterator.next()
|
|
39
39
|
}
|
|
40
|
-
while (
|
|
41
|
-
const [predication, promise] = await promiseRace(
|
|
42
|
-
|
|
40
|
+
while (promises.size > 0) {
|
|
41
|
+
const [predication, promise] = await promiseRace(promises)
|
|
42
|
+
promises.delete(promise)
|
|
43
43
|
if (!predication) {
|
|
44
44
|
return false
|
|
45
45
|
}
|
|
@@ -11,13 +11,13 @@ const promiseRace = require('./promiseRace')
|
|
|
11
11
|
* iterator Iterator|AsyncIterator,
|
|
12
12
|
* predicate any=>Promise|boolean,
|
|
13
13
|
* index number,
|
|
14
|
-
*
|
|
14
|
+
* promises Set<Promise>,
|
|
15
15
|
* maxConcurrency number=20,
|
|
16
16
|
* ) -> boolean
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
const asyncIteratorSome = async function (
|
|
20
|
-
iterator, predicate,
|
|
20
|
+
iterator, predicate, promises, maxConcurrency = 20,
|
|
21
21
|
) {
|
|
22
22
|
let iteration = iterator.next()
|
|
23
23
|
if (isPromise(iteration)) {
|
|
@@ -25,16 +25,16 @@ const asyncIteratorSome = async function (
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
while (!iteration.done) {
|
|
28
|
-
if (
|
|
29
|
-
const [predication, promise] = await promiseRace(
|
|
30
|
-
|
|
28
|
+
if (promises.size >= maxConcurrency) {
|
|
29
|
+
const [predication, promise] = await promiseRace(promises)
|
|
30
|
+
promises.delete(promise)
|
|
31
31
|
if (predication) {
|
|
32
32
|
return true
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
const predication = predicate(iteration.value)
|
|
36
36
|
if (isPromise(predication)) {
|
|
37
|
-
|
|
37
|
+
promises.add(SelfReferencingPromise(predication))
|
|
38
38
|
} else if (predication) {
|
|
39
39
|
return true
|
|
40
40
|
}
|
|
@@ -43,9 +43,9 @@ const asyncIteratorSome = async function (
|
|
|
43
43
|
iteration = await iteration
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
while (
|
|
47
|
-
const [predication, promise] = await promiseRace(
|
|
48
|
-
|
|
46
|
+
while (promises.size > 0) {
|
|
47
|
+
const [predication, promise] = await promiseRace(promises)
|
|
48
|
+
promises.delete(promise)
|
|
49
49
|
if (predication) {
|
|
50
50
|
return true
|
|
51
51
|
}
|
package/_internal/curryArity.js
CHANGED
|
@@ -9,13 +9,14 @@ const __ = require('./placeholder')
|
|
|
9
9
|
*
|
|
10
10
|
* var arity number,
|
|
11
11
|
* func function,
|
|
12
|
+
* context object,
|
|
12
13
|
* args Array<__|any>,
|
|
13
14
|
* curried function
|
|
14
15
|
*
|
|
15
|
-
* _curryArity(arity, func, args) -> curried|any
|
|
16
|
+
* _curryArity(context, arity, func, args) -> curried|any
|
|
16
17
|
* ```
|
|
17
18
|
*/
|
|
18
|
-
const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
|
|
19
|
+
const _curryArity = (arity, func, context, args) => function curried(...curriedArgs) {
|
|
19
20
|
const argsLength = args.length,
|
|
20
21
|
curriedArgsLength = curriedArgs.length,
|
|
21
22
|
nextArgs = []
|
|
@@ -36,8 +37,8 @@ const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
|
|
|
36
37
|
}
|
|
37
38
|
if (nextArgs.length == arity) {
|
|
38
39
|
return numCurriedPlaceholders == 0
|
|
39
|
-
? func(
|
|
40
|
-
: curryArity(arity, func, nextArgs)
|
|
40
|
+
? func.apply(context, nextArgs)
|
|
41
|
+
: curryArity(arity, func, context, nextArgs)
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
@@ -49,11 +50,11 @@ const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
|
|
|
49
50
|
nextArgs.push(curriedArg)
|
|
50
51
|
if (nextArgs.length == arity) {
|
|
51
52
|
return numCurriedPlaceholders == 0
|
|
52
|
-
? func(
|
|
53
|
-
: curryArity(arity, func, nextArgs)
|
|
53
|
+
? func.apply(context, nextArgs)
|
|
54
|
+
: curryArity(arity, func, context, nextArgs)
|
|
54
55
|
}
|
|
55
56
|
}
|
|
56
|
-
return curryArity(arity, func, nextArgs)
|
|
57
|
+
return curryArity(arity, func, context, nextArgs)
|
|
57
58
|
}
|
|
58
59
|
|
|
59
60
|
/**
|
|
@@ -65,29 +66,30 @@ const _curryArity = (arity, func, args) => function curried(...curriedArgs) {
|
|
|
65
66
|
*
|
|
66
67
|
* var arity number,
|
|
67
68
|
* func function,
|
|
69
|
+
* context object,
|
|
68
70
|
* args Array<__|any>,
|
|
69
71
|
* curried function
|
|
70
72
|
*
|
|
71
|
-
* curryArity(arity, func, args) -> curried|any
|
|
73
|
+
* curryArity(arity, func, context, args) -> curried|any
|
|
72
74
|
* ```
|
|
73
75
|
*
|
|
74
76
|
* @description
|
|
75
77
|
* Create a curried version of a function with specified arity.
|
|
76
78
|
*/
|
|
77
79
|
|
|
78
|
-
const curryArity = function (arity, func, args) {
|
|
80
|
+
const curryArity = function (arity, func, context, args) {
|
|
79
81
|
const argsLength = args.length
|
|
80
82
|
if (argsLength < arity) {
|
|
81
|
-
return _curryArity(arity, func, args)
|
|
83
|
+
return _curryArity(arity, func, context, args)
|
|
82
84
|
}
|
|
83
85
|
let argsIndex = -1
|
|
84
86
|
while (++argsIndex < argsLength) {
|
|
85
87
|
const arg = args[argsIndex]
|
|
86
88
|
if (arg == __) {
|
|
87
|
-
return _curryArity(arity, func, args)
|
|
89
|
+
return _curryArity(arity, func, context, args)
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
|
-
return func(
|
|
92
|
+
return func.apply(context, args)
|
|
91
93
|
}
|
|
92
94
|
|
|
93
95
|
module.exports = curryArity
|
|
@@ -11,7 +11,7 @@ const mapMapEntriesForEachCallback = (
|
|
|
11
11
|
) => function callback(value, key) {
|
|
12
12
|
const mapping = mapper([key, value])
|
|
13
13
|
if (isPromise(mapping)) {
|
|
14
|
-
promises.push(mapping.then(spread2(curryArity(3, mapSet, [result]))))
|
|
14
|
+
promises.push(mapping.then(spread2(curryArity(3, mapSet, this, [result]))))
|
|
15
15
|
} else {
|
|
16
16
|
result.set(mapping[0], mapping[1])
|
|
17
17
|
}
|
|
@@ -24,7 +24,7 @@ const objectMapEntries = function (object, mapper) {
|
|
|
24
24
|
mapping = mapper([key, value])
|
|
25
25
|
if (isPromise(mapping)) {
|
|
26
26
|
promises.push(mapping.then(
|
|
27
|
-
spread2(curryArity(3, objectSet, [result]))))
|
|
27
|
+
spread2(curryArity(3, objectSet, this, [result]))))
|
|
28
28
|
} else {
|
|
29
29
|
result[mapping[0]] = mapping[1]
|
|
30
30
|
}
|
package/curry.js
CHANGED
|
@@ -17,7 +17,7 @@ const curryArity = require('./_internal/curryArity')
|
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* @description
|
|
20
|
-
*
|
|
20
|
+
* Enables partial application of a function's arguments in any order. Provide the placeholder value `__` to specify an argument to be resolved in the partially applied function.
|
|
21
21
|
*
|
|
22
22
|
* ```javascript [playground]
|
|
23
23
|
* const add = (a, b, c) => a + b + c
|
|
@@ -38,11 +38,12 @@ const curryArity = require('./_internal/curryArity')
|
|
|
38
38
|
* * [thunkify](/docs/thunkify)
|
|
39
39
|
* * [always](/docs/always)
|
|
40
40
|
* * [curry.arity](/docs/curry.arity)
|
|
41
|
+
* * [curry.call](/docs/curry.call)
|
|
41
42
|
* * [__](/docs/__)
|
|
42
43
|
* * [Transducer.map](/docs/Transducer.map)
|
|
43
44
|
*
|
|
44
45
|
*/
|
|
45
|
-
const curry = (func, ...args) => curryArity(func.length, func, args)
|
|
46
|
+
const curry = (func, ...args) => curryArity(func.length, func, this, args)
|
|
46
47
|
|
|
47
48
|
/**
|
|
48
49
|
* @name curry.arity
|
|
@@ -74,12 +75,67 @@ const curry = (func, ...args) => curryArity(func.length, func, args)
|
|
|
74
75
|
* * [thunkify](/docs/thunkify)
|
|
75
76
|
* * [always](/docs/always)
|
|
76
77
|
* * [curry](/docs/curry)
|
|
78
|
+
* * [curry.call](/docs/curry.call)
|
|
77
79
|
* * [__](/docs/__)
|
|
78
80
|
* * [Transducer.map](/docs/Transducer.map)
|
|
79
81
|
*
|
|
80
82
|
*/
|
|
81
83
|
curry.arity = function curryArity_(arity, func, ...args) {
|
|
82
|
-
return curryArity(arity, func, args)
|
|
84
|
+
return curryArity(arity, func, this, args)
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
/**
|
|
88
|
+
* @name curry.call
|
|
89
|
+
*
|
|
90
|
+
* @synopsis
|
|
91
|
+
* ```coffeescript [specscript]
|
|
92
|
+
* type __ = Symbol(placeholder)
|
|
93
|
+
* type ArgsWithPlaceholder = Array<__|any>
|
|
94
|
+
*
|
|
95
|
+
* n number
|
|
96
|
+
* args ArgsWithPlaceholder
|
|
97
|
+
* moreArgs ArgsWithPlaceholder
|
|
98
|
+
*
|
|
99
|
+
* curry.call(func function, context object, ...args) -> curriedFuncOrResult function|any
|
|
100
|
+
* curriedFuncOrResult(...moreArgs) -> anotherCurriedFuncOrResult function|any
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @description
|
|
104
|
+
* `curry` with specified context.
|
|
105
|
+
*
|
|
106
|
+
* ```javascript [playground]
|
|
107
|
+
* class Point {
|
|
108
|
+
* constructor(x, y) {
|
|
109
|
+
* this.x = x
|
|
110
|
+
* this.y = y
|
|
111
|
+
* }
|
|
112
|
+
*
|
|
113
|
+
* toString() {
|
|
114
|
+
* return `(${this.x}, ${this.y})`
|
|
115
|
+
* }
|
|
116
|
+
* }
|
|
117
|
+
*
|
|
118
|
+
* const point = new Point(100, 100)
|
|
119
|
+
*
|
|
120
|
+
* const box = { x: 5, y: 10 }
|
|
121
|
+
*
|
|
122
|
+
* console.log(curry.call(point.toString, point))
|
|
123
|
+
* console.log(curry.call(point.toString, box))
|
|
124
|
+
* ```
|
|
125
|
+
*
|
|
126
|
+
* See also:
|
|
127
|
+
* * [eq](/docs/eq)
|
|
128
|
+
* * [thunkify](/docs/thunkify)
|
|
129
|
+
* * [always](/docs/always)
|
|
130
|
+
* * [curry](/docs/curry)
|
|
131
|
+
* * [curry.arity](/docs/curry.arity)
|
|
132
|
+
* * [__](/docs/__)
|
|
133
|
+
* * [Transducer.map](/docs/Transducer.map)
|
|
134
|
+
*
|
|
135
|
+
*/
|
|
136
|
+
curry.call = function call(func, context, ...args) {
|
|
137
|
+
return curryArity(func.length, func, context, args)
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
85
141
|
module.exports = curry
|
package/dist/Transducer.es.js
CHANGED
package/dist/Transducer.js
CHANGED
package/dist/Transducer.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.Transducer=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=Symbol.for("placeholder"),r=function(n,r,e){return r==t?((n,t)=>function(r){return n(r,t)})(n,e):((n,t)=>function(r){return n(t,r)})(n,r)},e=(e,o)=>function(u,c){const f=o(c);return n(f)?f.then(r(e,u,t)):e(u,f)},o=function(n,r,e,o){return r==t?((n,t,r)=>function(e){return n(e,t,r)})(n,e,o):e==t?((n,t,r)=>function(e){return n(t,e,r)})(n,r,o):((n,t,r)=>function(e){return n(t,r,e)})(n,r,e)},u=(n,t,r)=>function(){return n(t,r)},c=(n,t,r)=>n?t():r(),f=(r,e)=>function(f,i){const a=e(i);return n(a)?a.then(o(c,t,u(r,f,i),(s=f,function(){return s}))):a?r(f,i):f;var s},i=Array.isArray,a=(Object.values,Object.prototype.toString,async function(t,r,e){let o=t.next();if(o.done)return e;for(;!o.done;)e=r(e,o.value),n(e)&&(e=await e),o=t.next();return e}),s=Symbol.iterator,l=Symbol.asyncIterator,h=function(n,r,e,o,u){return r==t?((n,t,r,e)=>function(o){return n(o,t,r,e)})(n,e,o,u):e==t?((n,t,r,e)=>function(o){return n(t,o,r,e)})(n,r,o,u):o==t?((n,t,r,e)=>function(o){return n(t,r,o,e)})(n,r,e,u):((n,t,r,e)=>function(o){return n(t,r,e,o)})(n,r,e,o)},y=async function(t,r,e,o){const u=t.length;for(;++o<u;)e=r(e,t[o],o,t),n(e)&&(e=await e);return e},d=function(n,r,e,o,u,c){return r==t?((n,t,r,e,o)=>function(u){return n(u,t,r,e,o)})(n,e,o,u,c):e==t?((n,t,r,e,o)=>function(u){return n(t,u,r,e,o)})(n,r,o,u,c):o==t?((n,t,r,e,o)=>function(u){return n(t,r,u,e,o)})(n,r,e,u,c):u==t?((n,t,r,e,o)=>function(u){return n(t,r,e,u,o)})(n,r,e,o,c):((n,t,r,e,o)=>function(u){return n(t,r,e,o,u)})(n,r,e,o,u)},p=Object.keys,v=async function(t,r,e,o,u){const c=o.length;for(;++u<c;){const c=o[u];e=r(e,t[c],c,t),n(e)&&(e=await e)}return e},b=async function(t,r,e,o){for(const[u,c]of o)e=r(e,c,u,t),n(e)&&(e=await e);return e},x=function(e,u,c){return i(e)?function(r,e,o){const u=r.length;let c=-1;for(void 0===o&&(o=r[++c]);++c<u;)if(o=e(o,r[c],c,r),n(o))return o.then(h(y,r,e,t,c));return o}(e,u,c):null==e?void 0===c?r(u,e,t):u(c,e):e.constructor==Map?function(r,e,o){const u=r.entries();if(void 0===o){const n=u.next();if(n.done)return o;o=n.value[1]}for(const[c,f]of u)if(o=e(o,f,c,r),n(o))return o.then(h(b,r,e,t,u));return o}(e,u,c):"function"==typeof e[s]?function(r,e,u){let c=r.next();if(c.done)return u;for(void 0===u&&(u=c.value,c=r.next());!c.done;){if(u=e(u,c.value),n(u))return u.then(o(a,r,e,t));c=r.next()}return u}(e[s](),u,c):"function"==typeof e[l]?async function(n,t,r){let e=await n.next();if(e.done)return r;for(void 0===r&&(r=e.value,e=await n.next());!e.done;)r=await t(r,e.value),e=await n.next();return r}(e[l](),u,c):"function"==typeof e.reduce?e.reduce(u,c):"function"==typeof e.chain?e.chain(r(u,c,t)):"function"==typeof e.flatMap?e.flatMap(r(u,c,t)):e.constructor==Object?function(r,e,o){const u=p(r),c=u.length;let f=-1;for(void 0===o&&(o=r[u[++f]]);++f<c;){const c=u[f];if(o=e(o,r[c],c,r),n(o))return o.then(d(v,r,e,t,u,f))}return o}(e,u,c):void 0===c?r(u,e,t):u(c,e)},g=(r,e)=>function(u,c){const f=e(c);return n(f)?f.then(o(x,t,r,u)):x(f,r,u)},w=(t,r)=>function(e,o){const c=r(o);return n(c)?c.then(u(t,e,o)):t(e,o)},j=function(e,o,u,c,f){const i=e(u,f);return n(i)?i.then(r(o,c,t)):o(c,i)},m=function(r,e,o){const u=e(r);return function(e,c){try{const f=u(e,c);return n(f)?f.catch(d(j,o,r,t,e,c)):f}catch(n){return j(o,r,n,e,c)}}},M={map:function(n){return r(e,t,n)},filter:function(n){return r(f,t,n)},flatMap:function(n){return r(g,t,n)},forEach:function(n){return r(w,t,n)},passthrough:function(n){return n},tryCatch:function(n,r){return o(m,t,n,r)}};return M}());
|
package/dist/Transducer.mjs
CHANGED
package/dist/__.es.js
CHANGED
package/dist/__.es.min.js
CHANGED
package/dist/__.js
CHANGED
package/dist/__.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(e,o){"object"==typeof module?module.exports=o:"function"==typeof define?define((
|
|
8
|
+
!function(e,o){"object"==typeof module?module.exports=o:"function"==typeof define?define(()=>o):e.__=o}("object"==typeof globalThis?globalThis:this,function(){"use strict";return Symbol.for("placeholder")}());
|
package/dist/__.mjs
CHANGED
package/dist/all.es.js
CHANGED
package/dist/all.es.min.js
CHANGED
package/dist/all.js
CHANGED
package/dist/all.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.all=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=Array.isArray,r=function(r){if(t(r)){const t=r.length;let o=-1;for(;++o<t;){const t=r[o];if(n(t))return!0}return!1}for(const t in r){const o=r[t];if(n(o))return!0}return!1},o=Promise.all.bind(Promise),e=t=>new Promise((t=>function(r){const o={};let e=0;for(const u in t){const c=t[u];n(c)?(e+=1,c.then((n=>function(t){o[n]=t,e-=1,0==e&&r(o)})(u))):o[u]=c}0==e&&r(o)})(t)),u=Symbol.for("placeholder"),c=function(n,t,r){return t==u?((n,t)=>function(r){return n(r,t)})(n,r):((n,t)=>function(r){return n(t,r)})(n,t)},f=function(n,t,r){return t==u?((n,t)=>function(...r){return n(r,t)})(n,r):((n,t)=>function(...r){return n(t,r)})(n,t)},i=function(t,r){const e=t.length,u=Array(e);let c=-1,f=!1;for(;++c<e;){const o=t[c],e="function"==typeof o?o(...r):o;n(e)&&(f=!0),u[c]=e}return f?o(u):u},s=(t,r)=>function(...o){const e=t(...o);return n(e)?e.then(r):r(e)},l=function(n,t,r,o){return t==u?((n,t,r)=>function(o){return n(o,t,r)})(n,r,o):r==u?((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)},h=function(n,t,r,o,e){return t==u?((n,t,r,o)=>function(e){return n(e,t,r,o)})(n,r,o,e):r==u?((n,t,r,o)=>function(e){return n(t,e,r,o)})(n,t,o,e):o==u?((n,t,r,o)=>function(e){return n(t,r,e,o)})(n,t,r,e):((n,t,r,o)=>function(e){return n(t,r,o,e)})(n,t,r,o)},p=function(n,t,r){return n[t]=r,n},y=async function(t,r,o,e){const u=t.length;for(;++e<u;){const u=t[e](...r);o[e]=n(u)?await u:u}return o},a=function(t,r){const o=t.length,e=[];let c=-1;for(;++c<o;){const o=t[c](...r);if(n(o))return o.then(s(l(p,e,c,u),h(y,t,r,u,c)));e[c]=o}return e},g=function(t,r){const e={},c=[];for(const o in t){const f=t[o],i="function"==typeof f?f(...r):f;n(i)?c.push(i.then(l(p,e,o,u))):e[o]=i}return 0==c.length?e:o(c).then((f=e,function(){return f}));var f},b=function(n){return t(n)?r(n)?o(n):n:r(n)?e(n):n},d=function(...e){if(1==e.length){const r=e[0];return n(r)?r.then(b):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}(r)?b(r):t(r)?f(i,r,u):f(g,r,u)}const s=e[e.length-1],l=e.slice(0,-1);return r(l)?t(s)?o(l).then(c(i,s,u)):o(l).then(c(g,s,u)):t(s)?i(s,l):g(s,l)};return d.series=function(...n){const t=n.pop();return 0==n.length?f(a,t,u):r(n)?o(n).then(c(a,t,u)):a(t,n)},d}());
|
package/dist/all.mjs
CHANGED
package/dist/always.es.js
CHANGED
package/dist/always.es.min.js
CHANGED
package/dist/always.js
CHANGED
package/dist/always.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(e,t){"object"==typeof module?module.exports=t:"function"==typeof define?define((
|
|
8
|
+
!function(e,t){"object"==typeof module?module.exports=t:"function"==typeof define?define(()=>t):e.always=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";return e=>function(){return e}}());
|
package/dist/always.mjs
CHANGED
package/dist/and.es.js
CHANGED
package/dist/and.es.min.js
CHANGED
package/dist/and.js
CHANGED
package/dist/and.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.and=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=Promise.all.bind(Promise),t=n=>null!=n&&"function"==typeof n.then,r=Array.isArray,e=Symbol.for("placeholder"),o=function(n,t,r,o){return t==e?((n,t,r)=>function(e){return n(e,t,r)})(n,r,o):r==e?((n,t,r)=>function(e){return n(t,e,r)})(n,t,o):((n,t,r)=>function(e){return n(t,r,e)})(n,t,r)},u=(n,t,r)=>n?t():r(),f=(n,t,r)=>function(){return n(t,r)},i=(n,t,r,e)=>function(){return n(t,r,e)},c=n=>function(){return n},l=function(n,r){const i=n.length;for(;++r<i;){const i=n[r];if(t(i))return i.then(o(u,e,f(l,n,r),c(!1)));if(!i)return!1}return!0},s=async function(n,r,e){const o=r.length;for(;++e<o;){let o=r[e];if("function"==typeof o&&(o=o(...n)),t(o)&&(o=await o),!o)return!1}return!0},h=function(n,r){const f=r.length;let l=-1;for(;++l<f;){let f=r[l];if("function"==typeof f&&(f=f(...n)),t(f))return f.then(o(u,e,i(s,n,r,l),c(!1)));if(!f)return!1}return!0};return function(...o){const u=o.pop();return function(n){if(r(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}(u)?l(u,-1):0==o.length?(f=h,c=u,(i=e)==e?((n,t)=>function(...r){return n(r,t)})(f,c):((n,t)=>function(...r){return n(t,r)})(f,i)):function(n){if(r(n)){const r=n.length;let e=-1;for(;++e<r;){const r=n[e];if(t(r))return!0}return!1}for(const r in n){const e=n[r];if(t(e))return!0}return!1}(o)?n(o).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)}(h,e,u)):h(o,u);var f,i,c}}());
|
package/dist/and.mjs
CHANGED
package/dist/assign.es.js
CHANGED
package/dist/assign.es.min.js
CHANGED
package/dist/assign.js
CHANGED
package/dist/assign.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.assign=t}("object"==typeof globalThis?globalThis:this,function(){"use strict";const n=n=>null!=n&&"function"==typeof n.then,t=Object.assign,o=Symbol.for("placeholder"),e=function(n,t,e){return t==o?((n,t)=>function(o){return n(o,t)})(n,e):((n,t)=>function(o){return n(t,o)})(n,t)},u=function(n,t,e,u){return t==o?((n,t,o)=>function(e){return n(e,t,o)})(n,e,u):e==o?((n,t,o)=>function(e){return n(t,e,o)})(n,t,u):((n,t,o)=>function(e){return n(t,o,e)})(n,t,e)},r=Promise.all.bind(Promise),i=function(n,t,o){return n[t]=o,n},c=function(e,c){const f=function(t,e){const c={},f=[];for(const r in t){const s=t[r],l="function"==typeof s?s(...e):s;n(l)?f.push(l.then(u(i,c,r,o))):c[r]=l}return 0==f.length?c:r(f).then((s=c,function(){return s}));var s}(c,[e]);return n(f)?f.then(u(t,{},e,o)):{...e,...f}};return function(t,u){return null==u?e(c,o,t):n(t)?t.then(e(c,o,u)):c(t,u)}}());
|