ig-types 6.26.2 → 6.26.3
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/LICENSE +1 -1
- package/Promise.js +4 -0
- package/README.md +8 -3
- package/package.json +1 -1
- package/test.js +0 -0
package/LICENSE
CHANGED
package/Promise.js
CHANGED
|
@@ -1367,6 +1367,9 @@ object.Mixin('PromiseMixin', 'soft', {
|
|
|
1367
1367
|
// -> <value>
|
|
1368
1368
|
// -> <promise>
|
|
1369
1369
|
//
|
|
1370
|
+
// XXX BUG:
|
|
1371
|
+
// Promise.awaitOrRun(1,2,3, function(){ throw new Error('moo') })
|
|
1372
|
+
// -> TypeError: error[0] is not a functon
|
|
1370
1373
|
// XXX should this be implemented via SyncPromise???
|
|
1371
1374
|
// XXX not sure if we need to expand async generators...
|
|
1372
1375
|
// (update README if this changes)
|
|
@@ -1375,6 +1378,7 @@ object.Mixin('PromiseMixin', 'soft', {
|
|
|
1375
1378
|
var mode = 'deep'
|
|
1376
1379
|
data = [...arguments]
|
|
1377
1380
|
func = data.pop()
|
|
1381
|
+
error = null
|
|
1378
1382
|
if(data.length > 1
|
|
1379
1383
|
&& (typeof(data.at(-1)) == 'function'
|
|
1380
1384
|
|| func == null)){
|
package/README.md
CHANGED
|
@@ -2201,14 +2201,19 @@ relevant items in the input are either non-promises or `<sync-promise>`s.
|
|
|
2201
2201
|
|
|
2202
2202
|
#### `Promise.awaitOrRun(..)`
|
|
2203
2203
|
|
|
2204
|
-
Await for inputs
|
|
2205
|
-
the
|
|
2204
|
+
Await for inputs passing their resolved values to a function, either
|
|
2205
|
+
directly returning the result, if none of the inputs was a promise (sync),
|
|
2206
|
+
or returning a promise resolving to the function's return value, if any of
|
|
2207
|
+
the inputs was a promise.
|
|
2206
2208
|
|
|
2207
2209
|
```dnf
|
|
2208
2210
|
Promise.awaitOrRun(<value>, <func>[, <onerror>])
|
|
2209
2211
|
Promise.awaitOrRun(<value>, .. , <func>[, <onerror>])
|
|
2210
2212
|
-> <promise(value)>
|
|
2211
2213
|
-> <value>
|
|
2214
|
+
|
|
2215
|
+
<func>(<value>, .. )
|
|
2216
|
+
-> value
|
|
2212
2217
|
```
|
|
2213
2218
|
|
|
2214
2219
|
Note that if the last `<value>` is a function and no `<onerror>` function
|
|
@@ -3525,7 +3530,7 @@ This includes [`event.EventMixin`](#eventeventmixin).
|
|
|
3525
3530
|
|
|
3526
3531
|
[BSD 3-Clause License](./LICENSE)
|
|
3527
3532
|
|
|
3528
|
-
Copyright (c) 2020, Alex A. Naanou,
|
|
3533
|
+
Copyright (c) 2020-2023, Alex A. Naanou,
|
|
3529
3534
|
All rights reserved.
|
|
3530
3535
|
|
|
3531
3536
|
|
package/package.json
CHANGED
package/test.js
CHANGED
|
File without changes
|