diff --git a/Promise.js b/Promise.js index 3b37836..77b9fd1 100644 --- a/Promise.js +++ b/Promise.js @@ -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() ? diff --git a/package-lock.json b/package-lock.json index e19aa96..74b6326 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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",