@rimbu/stream
Advanced tools
Comparing version 0.7.4 to 0.7.5
@@ -435,3 +435,5 @@ "use strict"; | ||
var oldReturn_1 = iterator.return; | ||
iterator.return = function () { return Promise.all([oldReturn_1, close]); }; | ||
iterator.return = function () { | ||
return Promise.all([oldReturn_1, close]); | ||
}; | ||
return iterator; | ||
@@ -438,0 +440,0 @@ } |
{ | ||
"name": "@rimbu/stream", | ||
"version": "0.7.4", | ||
"version": "0.7.5", | ||
"description": "Efficient structure representing a sequence of elements, with powerful operations for TypeScript", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
], | ||
"homepage": "http://rimbu.org", | ||
"homepage": "https://rimbu.org", | ||
"author": { | ||
@@ -62,4 +62,4 @@ "name": "Arvid Nicolaas", | ||
"dependencies": { | ||
"@rimbu/base": "^0.6.6", | ||
"@rimbu/common": "^0.7.4", | ||
"@rimbu/base": "^0.6.7", | ||
"@rimbu/common": "^0.7.5", | ||
"tslib": "^2.3.1" | ||
@@ -73,3 +73,3 @@ }, | ||
}, | ||
"gitHead": "e509f9938fad6253702f6b78eb9f8e3b3a8f92ac" | ||
"gitHead": "20739fd0c0d5c565eeecd3e266dd51f893e8d67c" | ||
} |
@@ -19,5 +19,5 @@ <p align="center"> | ||
For complete documentation please visit the _[Rimbu Docs](http://rimbu.org)_. | ||
For complete documentation please visit the [Stream page](https://rimbu.org/docs/collections/stream) in the _[Rimbu Docs](https://rimbu.org)_. | ||
Or [Try Me Out](https://codesandbox.io/s/rimbu-sandbox-d4tbk?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox. | ||
Or [Try Out Rimbu](https://codesandbox.io/s/github/vitoke/rimbu-sandbox/tree/main?previewwindow=console&view=split&editorsize=65&moduleview=1&module=/src/index.ts) in CodeSandBox. | ||
@@ -24,0 +24,0 @@ ## Installation |
@@ -851,3 +851,3 @@ import { | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
if (this.prependDone) return closeIters(this.source); | ||
@@ -901,3 +901,3 @@ }; | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
if (!this.appendDone) return closeIters(source); | ||
@@ -947,3 +947,3 @@ }; | ||
this.index = startIndex; | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1021,3 +1021,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1102,3 +1102,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1146,3 +1146,4 @@ | ||
this.iterator = this.source[Symbol.asyncIterator](); | ||
this.return = () => closeIters(this.currentIterator, this.iterator); | ||
this.return = (): Promise<void> => | ||
closeIters(this.currentIterator, this.iterator); | ||
} | ||
@@ -1203,3 +1204,3 @@ | ||
this.iterator = source[Symbol.asyncIterator](); | ||
this.return = () => closeIters(this.iterator); | ||
this.return = (): Promise<void> => closeIters(this.iterator); | ||
} | ||
@@ -1209,3 +1210,3 @@ | ||
async fastNext<O>(otherwise?: AsyncOptLazy<O>) { | ||
async fastNext<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O> { | ||
const done = Symbol('Done'); | ||
@@ -1256,3 +1257,3 @@ let value: T | typeof done; | ||
super(); | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
if (!this.isDone) return closeIters(this.sepIterator, this.source); | ||
@@ -1340,3 +1341,3 @@ }; | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1417,3 +1418,3 @@ | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1467,3 +1468,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1531,3 +1532,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1578,3 +1579,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1624,3 +1625,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1673,3 +1674,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1715,3 +1716,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1757,3 +1758,3 @@ | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
@@ -1806,3 +1807,3 @@ this.remain = amount; | ||
this.iterator = source[Symbol.asyncIterator](); | ||
this.return = () => closeIters(this.iterator); | ||
this.return = (): Promise<void> => closeIters(this.iterator); | ||
@@ -1856,3 +1857,3 @@ this.remain = amount; | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1922,3 +1923,3 @@ | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -1971,3 +1972,3 @@ | ||
super(); | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -2033,3 +2034,3 @@ | ||
this.return = () => closeIters(source); | ||
this.return = (): Promise<void> => closeIters(source); | ||
} | ||
@@ -2118,3 +2119,3 @@ | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
await closeIters(source); | ||
@@ -2228,3 +2229,3 @@ | ||
this.return = () => closeIters(...this.sourcesToClose); | ||
this.return = (): Promise<void> => closeIters(...this.sourcesToClose); | ||
} | ||
@@ -2278,3 +2279,3 @@ | ||
this.return = () => closeIters(...this.sourcesToClose); | ||
this.return = (): Promise<void> => closeIters(...this.sourcesToClose); | ||
} | ||
@@ -2281,0 +2282,0 @@ |
@@ -283,5 +283,6 @@ import { RimbuError, Token } from '@rimbu/base'; | ||
if (source.return && close) { | ||
this.return = () => Promise.all([source.return?.(), close?.()]); | ||
this.return = (): Promise<any> => | ||
Promise.all([source.return?.(), close?.()]); | ||
} else if (source.return) { | ||
this.return = () => source.return?.(); | ||
this.return = (): Promise<any> | undefined => source.return?.(); | ||
} else if (close) { | ||
@@ -336,3 +337,3 @@ this.return = close; | ||
super(); | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
if (close) await close?.(); | ||
@@ -387,3 +388,4 @@ if (this.iterator) await this.iterator.return?.(); | ||
(iterator as any).return = () => Promise.all([oldReturn, close]); | ||
(iterator as any).return = (): Promise<any> => | ||
Promise.all([oldReturn, close]); | ||
@@ -429,3 +431,3 @@ return iterator; | ||
this.return = async () => { | ||
this.return = async (): Promise<void> => { | ||
if (this.resource) await close(this.resource); | ||
@@ -439,3 +441,3 @@ await this.iterator?.return?.(); | ||
async fastNext<O>(otherwise?: AsyncOptLazy<O>) { | ||
async fastNext<O>(otherwise?: AsyncOptLazy<O>): Promise<T | O> { | ||
if (undefined === this.iterator) { | ||
@@ -442,0 +444,0 @@ const resource = await this.open(); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
1049580
20154
Updated@rimbu/base@^0.6.7
Updated@rimbu/common@^0.7.5