ig-types 6.26.1 → 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 CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2020, Alex A. Naanou
1
+ Copyright (c) 2020-2023, Alex A. Naanou
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
package/Promise.js CHANGED
@@ -416,6 +416,7 @@ object.Constructor('IterablePromise', Promise, {
416
416
  //
417
417
  // pack and oprionally transform/handle an array (sync)...
418
418
  __pack: function(list, handler=undefined, onerror=undefined){
419
+ var that = this
419
420
  // handle iterable promise...
420
421
  if(list instanceof IterablePromise){
421
422
  return this.__handle(list.__packed, handler, onerror) }
@@ -1366,6 +1367,9 @@ object.Mixin('PromiseMixin', 'soft', {
1366
1367
  // -> <value>
1367
1368
  // -> <promise>
1368
1369
  //
1370
+ // XXX BUG:
1371
+ // Promise.awaitOrRun(1,2,3, function(){ throw new Error('moo') })
1372
+ // -> TypeError: error[0] is not a functon
1369
1373
  // XXX should this be implemented via SyncPromise???
1370
1374
  // XXX not sure if we need to expand async generators...
1371
1375
  // (update README if this changes)
@@ -1374,6 +1378,7 @@ object.Mixin('PromiseMixin', 'soft', {
1374
1378
  var mode = 'deep'
1375
1379
  data = [...arguments]
1376
1380
  func = data.pop()
1381
+ error = null
1377
1382
  if(data.length > 1
1378
1383
  && (typeof(data.at(-1)) == 'function'
1379
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 if any of them is a promise and then run a function with
2205
- the results, otherwise run the function in sync.
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ig-types",
3
- "version": "6.26.1",
3
+ "version": "6.26.3",
4
4
  "description": "Generic JavaScript types and type extensions...",
5
5
  "main": "main.js",
6
6
  "scripts": {
package/test.js CHANGED
File without changes