mergeiterator
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -0,1 +1,7 @@ | ||
## 1.3.1 | ||
fix: | ||
* change ts return type to AsyncGenerator | ||
## 1.3.0 | ||
@@ -2,0 +8,0 @@ |
@@ -227,12 +227,15 @@ "use strict"; | ||
const stopIterator = iterator => PromiseTry(() => iterator.return ? iterator.return() : { | ||
done: true, | ||
value: undefined | ||
}).then(({ | ||
done, | ||
value | ||
}) => Promise.resolve(value).then(v => ({ | ||
done, | ||
value: v | ||
}))); | ||
const stopIterator = iterator => PromiseTry(() => { | ||
const ret = iterator.return; | ||
return !ret ? { | ||
done: true, | ||
value: undefined | ||
} : Promise.resolve(ret.call(iterator)).then(({ | ||
done, | ||
value | ||
}) => Promise.resolve(value).then(v => ({ | ||
done, | ||
value: v | ||
}))); | ||
}); | ||
@@ -239,0 +242,0 @@ const PromiseTry = func => { |
{ | ||
"name": "mergeiterator", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "merges async iterators", | ||
@@ -50,3 +50,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"type-any-iterable": "^1.0.3" | ||
"type-any-iterable": "^1.0.5" | ||
}, | ||
@@ -72,7 +72,7 @@ "peerDependencies": {}, | ||
"eslint-config-prettier": "^6.9.0", | ||
"eslint-plugin-flowtype": "^4.5.2", | ||
"eslint-plugin-flowtype": "^4.5.3", | ||
"eslint-plugin-flowtype-errors": "^4.1.0", | ||
"eslint-plugin-import": "^2.19.1", | ||
"eslint-plugin-prettier": "^3.1.2", | ||
"flow-bin": "^0.114.0", | ||
"flow-bin": "^0.115.0", | ||
"flow-copy-source": "^2.0.9", | ||
@@ -79,0 +79,0 @@ "flow-typed": "^2.6.2", |
import { AnyIterable } from "type-any-iterable" | ||
export default function merge<T>(sequences: AnyIterable<AnyIterable<T>>): AsyncIterable<T> | ||
export default function merge<T>(sequences: AnyIterable<AnyIterable<T>>): AsyncGenerator<T> |
@@ -181,5 +181,8 @@ // @flow | ||
const stopIterator = iterator => | ||
PromiseTry(() => (iterator.return ? iterator.return() : { done: true, value: undefined })).then(({ done, value }) => | ||
Promise.resolve(value).then(v => ({ done, value: v })), | ||
) | ||
PromiseTry(() => { | ||
const ret = iterator.return | ||
return !ret | ||
? { done: true, value: undefined } | ||
: Promise.resolve(ret.call(iterator)).then(({ done, value }) => Promise.resolve(value).then(v => ({ done, value: v }))) | ||
}) | ||
@@ -186,0 +189,0 @@ const PromiseTry = func => { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23418
411
Updatedtype-any-iterable@^1.0.5