tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-12-29 01:12:49 +03:00
parent 6a77aaab91
commit 7ddd951af2
2 changed files with 22 additions and 12 deletions

View File

@ -336,21 +336,31 @@ object.Constructor('IterablePromise', Promise, {
return list
[map](function(elem){
//* XXX migrate code from old .__pack(..)...
// XXX these are not the same:
// XXX examples...
// correct:
// await Promise.iter(
// ['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])])
// and:
// ['a','b','c', [3,2,1], Promise.all([1,2,3])])
// -> ['a','b','c', [3,2,1], [1,2,3]]
// correct:
// await Promise.iter(
// ['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])],
// ['a','b','c', [3,2,1], Promise.all([1,2,3])],
// 'raw')
// -> ['a','b','c', 3,2,1, 1,2,3]
// should be the same as above (should expand promise):
// await Promise.iter(
// ['a','b','c', [3,2,1], Promise.all([1,2,3])],
// e => e)
// this produces the correct result:
// -> ['a','b','c', 3,2,1, [1,2,3]]
// should be the same as above:
// await Promise.iter(
// ['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])],
// ['a','b','c', [3,2,1], Promise.all([1,2,3])])
// .flat()
// -> ['a','b','c', 3,2,1, [1,2,3]]
// correct:
// await Promise.iter(
// ['a','b','c', [3,2,1], Promise.all([1,2,3])],
// e => [e])
// this does not flatten the promise:
// await Promise.iter(
// ['a', 'b', 'c', [3,2,1], Promise.all([1,2,3])])
// .flat()
// -> ['a','b','c', [3,2,1], [1,2,3]]
// XXX need a strict spec...
return elem instanceof IterablePromise ?
(elem.isSync() ?

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "ig-types",
"version": "6.24.8",
"version": "6.24.10",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ig-types",
"version": "6.24.8",
"version": "6.24.10",
"license": "BSD-3-Clause",
"dependencies": {
"ig-object": "^6.0.0",