mirror of
https://github.com/flynx/types.js.git
synced 2025-10-29 02:20:07 +00:00
tweaks...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
6a77aaab91
commit
7ddd951af2
30
Promise.js
30
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() ?
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user