@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.
@@ -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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@naturalcycles/nodejs-lib",
3
3
  "type": "module",
4
- "version": "15.29.0",
4
+ "version": "15.30.0",
5
5
  "dependencies": {
6
6
  "@naturalcycles/js-lib": "^15",
7
7
  "@types/js-yaml": "^4",
@@ -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,