@naturalcycles/nodejs-lib 15.29.0 → 15.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/stream/pipeline.js
CHANGED
|
@@ -101,6 +101,11 @@ export class Pipeline {
|
|
|
101
101
|
* less clean than `.take()` on the source.
|
|
102
102
|
*/
|
|
103
103
|
limit(limit) {
|
|
104
|
+
if (!this.transforms.length) {
|
|
105
|
+
console.warn(`Pipeline.limit was used as a very first Transfrom - please use Pipeline.limitSource instead`);
|
|
106
|
+
this.limitSource(limit);
|
|
107
|
+
return this;
|
|
108
|
+
}
|
|
104
109
|
this.transforms.push(transformLimit({
|
|
105
110
|
limit,
|
|
106
111
|
signal: this.abortableSignal,
|
package/package.json
CHANGED
package/src/stream/pipeline.ts
CHANGED
|
@@ -140,6 +140,14 @@ export class Pipeline<T = unknown> {
|
|
|
140
140
|
* less clean than `.take()` on the source.
|
|
141
141
|
*/
|
|
142
142
|
limit(limit: NonNegativeInteger | undefined): this {
|
|
143
|
+
if (!this.transforms.length) {
|
|
144
|
+
console.warn(
|
|
145
|
+
`Pipeline.limit was used as a very first Transfrom - please use Pipeline.limitSource instead`,
|
|
146
|
+
)
|
|
147
|
+
this.limitSource(limit)
|
|
148
|
+
return this
|
|
149
|
+
}
|
|
150
|
+
|
|
143
151
|
this.transforms.push(
|
|
144
152
|
transformLimit({
|
|
145
153
|
limit,
|