Skip to content

Commit d669f22

Browse files
aduh95danielleadams
authored andcommitted
stream: add trailing commas in stream source files
PR-URL: #46686 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 320a8ad commit d669f22

13 files changed

+63
-62
lines changed

lib/.eslintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ overrides:
278278
- ./internal/readme.md
279279
- ./internal/repl/history.js
280280
- ./internal/source_map/prepare_stack_trace.js
281+
- ./internal/streams/*.js
281282
- ./internal/structured_clone.js
282283
- ./internal/test/*.js
283284
- ./internal/test_runner/**/*.js

lib/internal/streams/buffer_list.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ module.exports = class BufferList {
175175
// Only inspect one level.
176176
depth: 0,
177177
// It should not recurse.
178-
customInspect: false
178+
customInspect: false,
179179
});
180180
}
181181
};

lib/internal/streams/destroy.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
kDestroyed,
1515
isDestroyed,
1616
isFinished,
17-
isServerRequest
17+
isServerRequest,
1818
} = require('internal/streams/utils');
1919

2020
const kDestroy = Symbol('kDestroy');
@@ -334,5 +334,5 @@ module.exports = {
334334
destroyer,
335335
destroy,
336336
undestroy,
337-
errorOrDestroy
337+
errorOrDestroy,
338338
};

lib/internal/streams/duplex.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ ObjectDefineProperties(Duplex.prototype, {
114114
this._readableState.destroyed = value;
115115
this._writableState.destroyed = value;
116116
}
117-
}
118-
}
117+
},
118+
},
119119
});
120120

121121
let webStreamsAdapters;

lib/internal/streams/duplexify.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const {
2929
const { AbortController } = require('internal/abort_controller');
3030

3131
const {
32-
FunctionPrototypeCall
32+
FunctionPrototypeCall,
3333
} = primordials;
3434

3535
// This is needed for pre node 17.
@@ -90,7 +90,7 @@ module.exports = function duplexify(body, name) {
9090
objectMode: true,
9191
write,
9292
final,
93-
destroy
93+
destroy,
9494
});
9595
}
9696

@@ -126,7 +126,7 @@ module.exports = function duplexify(body, name) {
126126
}
127127
});
128128
},
129-
destroy
129+
destroy,
130130
});
131131
}
132132

@@ -142,7 +142,7 @@ module.exports = function duplexify(body, name) {
142142
return from(Duplexify, body, {
143143
// TODO (ronag): highWaterMark?
144144
objectMode: true,
145-
writable: false
145+
writable: false,
146146
});
147147
}
148148

@@ -192,7 +192,7 @@ module.exports = function duplexify(body, name) {
192192
return d = new Duplexify({
193193
objectMode: true,
194194
writable: false,
195-
read() {}
195+
read() {},
196196
});
197197
}
198198

@@ -236,7 +236,7 @@ function fromAsyncGen(fn) {
236236
destroy(err, cb) {
237237
ac.abort();
238238
cb(err);
239-
}
239+
},
240240
};
241241
}
242242

lib/internal/streams/end-of-stream.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const {
99
} = require('internal/errors');
1010
const {
1111
ERR_INVALID_ARG_TYPE,
12-
ERR_STREAM_PREMATURE_CLOSE
12+
ERR_STREAM_PREMATURE_CLOSE,
1313
} = codes;
1414
const {
1515
kEmptyObject,
@@ -19,7 +19,7 @@ const {
1919
validateAbortSignal,
2020
validateFunction,
2121
validateObject,
22-
validateBoolean
22+
validateBoolean,
2323
} = require('internal/validators');
2424

2525
const { Promise, PromisePrototypeThen } = primordials;

lib/internal/streams/from.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const { Buffer } = require('buffer');
99

1010
const {
1111
ERR_INVALID_ARG_TYPE,
12-
ERR_STREAM_NULL_VALUES
12+
ERR_STREAM_NULL_VALUES,
1313
} = require('internal/errors').codes;
1414

1515
function from(Readable, iterable, opts) {
@@ -21,7 +21,7 @@ function from(Readable, iterable, opts) {
2121
read() {
2222
this.push(iterable);
2323
this.push(null);
24-
}
24+
},
2525
});
2626
}
2727

lib/internal/streams/lazy_transform.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const {
1212
const stream = require('stream');
1313

1414
const {
15-
getDefaultEncoding
15+
getDefaultEncoding,
1616
} = require('internal/crypto/util');
1717

1818
module.exports = LazyTransform;
@@ -43,7 +43,7 @@ function makeSetter(name) {
4343
value: val,
4444
enumerable: true,
4545
configurable: true,
46-
writable: true
46+
writable: true,
4747
});
4848
};
4949
}
@@ -54,13 +54,13 @@ ObjectDefineProperties(LazyTransform.prototype, {
5454
get: makeGetter('_readableState'),
5555
set: makeSetter('_readableState'),
5656
configurable: true,
57-
enumerable: true
57+
enumerable: true,
5858
},
5959
_writableState: {
6060
__proto__: null,
6161
get: makeGetter('_writableState'),
6262
set: makeSetter('_writableState'),
6363
configurable: true,
64-
enumerable: true
65-
}
64+
enumerable: true,
65+
},
6666
});

lib/internal/streams/pipeline.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const {
2727

2828
const {
2929
validateFunction,
30-
validateAbortSignal
30+
validateAbortSignal,
3131
} = require('internal/validators');
3232

3333
const {
@@ -60,7 +60,7 @@ function destroyer(stream, reading, writing) {
6060
finished = true;
6161
destroyImpl.destroyer(stream, err || new ERR_STREAM_DESTROYED('pipe'));
6262
},
63-
cleanup
63+
cleanup,
6464
};
6565
}
6666

@@ -314,7 +314,7 @@ function pipelineImpl(streams, callback, opts) {
314314
// composed through `.pipe(stream)`.
315315

316316
const pt = new PassThrough({
317-
objectMode: true
317+
objectMode: true,
318318
});
319319

320320
// Handle Promises/A+ spec, `then` could be a getter that throws on

lib/internal/streams/readable.js

+20-20
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const {
3232
Promise,
3333
SafeSet,
3434
SymbolAsyncIterator,
35-
Symbol
35+
Symbol,
3636
} = primordials;
3737

3838
module.exports = Readable;
@@ -54,7 +54,7 @@ const BufferList = require('internal/streams/buffer_list');
5454
const destroyImpl = require('internal/streams/destroy');
5555
const {
5656
getHighWaterMark,
57-
getDefaultHighWaterMark
57+
getDefaultHighWaterMark,
5858
} = require('internal/streams/state');
5959

6060
const {
@@ -65,7 +65,7 @@ const {
6565
ERR_OUT_OF_RANGE,
6666
ERR_STREAM_PUSH_AFTER_EOF,
6767
ERR_STREAM_UNSHIFT_AFTER_END_EVENT,
68-
}
68+
},
6969
} = require('internal/errors');
7070
const { validateObject } = require('internal/validators');
7171

@@ -1166,15 +1166,15 @@ ObjectDefineProperties(Readable.prototype, {
11661166
if (this._readableState) {
11671167
this._readableState.readable = !!val;
11681168
}
1169-
}
1169+
},
11701170
},
11711171

11721172
readableDidRead: {
11731173
__proto__: null,
11741174
enumerable: false,
11751175
get: function() {
11761176
return this._readableState.dataEmitted;
1177-
}
1177+
},
11781178
},
11791179

11801180
readableAborted: {
@@ -1186,23 +1186,23 @@ ObjectDefineProperties(Readable.prototype, {
11861186
(this._readableState.destroyed || this._readableState.errored) &&
11871187
!this._readableState.endEmitted
11881188
);
1189-
}
1189+
},
11901190
},
11911191

11921192
readableHighWaterMark: {
11931193
__proto__: null,
11941194
enumerable: false,
11951195
get: function() {
11961196
return this._readableState.highWaterMark;
1197-
}
1197+
},
11981198
},
11991199

12001200
readableBuffer: {
12011201
__proto__: null,
12021202
enumerable: false,
12031203
get: function() {
12041204
return this._readableState && this._readableState.buffer;
1205-
}
1205+
},
12061206
},
12071207

12081208
readableFlowing: {
@@ -1215,46 +1215,46 @@ ObjectDefineProperties(Readable.prototype, {
12151215
if (this._readableState) {
12161216
this._readableState.flowing = state;
12171217
}
1218-
}
1218+
},
12191219
},
12201220

12211221
readableLength: {
12221222
__proto__: null,
12231223
enumerable: false,
12241224
get() {
12251225
return this._readableState.length;
1226-
}
1226+
},
12271227
},
12281228

12291229
readableObjectMode: {
12301230
__proto__: null,
12311231
enumerable: false,
12321232
get() {
12331233
return this._readableState ? this._readableState.objectMode : false;
1234-
}
1234+
},
12351235
},
12361236

12371237
readableEncoding: {
12381238
__proto__: null,
12391239
enumerable: false,
12401240
get() {
12411241
return this._readableState ? this._readableState.encoding : null;
1242-
}
1242+
},
12431243
},
12441244

12451245
errored: {
12461246
__proto__: null,
12471247
enumerable: false,
12481248
get() {
12491249
return this._readableState ? this._readableState.errored : null;
1250-
}
1250+
},
12511251
},
12521252

12531253
closed: {
12541254
__proto__: null,
12551255
get() {
12561256
return this._readableState ? this._readableState.closed : false;
1257-
}
1257+
},
12581258
},
12591259

12601260
destroyed: {
@@ -1273,15 +1273,15 @@ ObjectDefineProperties(Readable.prototype, {
12731273
// Backward compatibility, the user is explicitly
12741274
// managing destroyed.
12751275
this._readableState.destroyed = value;
1276-
}
1276+
},
12771277
},
12781278

12791279
readableEnded: {
12801280
__proto__: null,
12811281
enumerable: false,
12821282
get() {
12831283
return this._readableState ? this._readableState.endEmitted : false;
1284-
}
1284+
},
12851285
},
12861286

12871287
});
@@ -1292,7 +1292,7 @@ ObjectDefineProperties(ReadableState.prototype, {
12921292
__proto__: null,
12931293
get() {
12941294
return this.pipes.length;
1295-
}
1295+
},
12961296
},
12971297

12981298
// Legacy property for `paused`.
@@ -1303,8 +1303,8 @@ ObjectDefineProperties(ReadableState.prototype, {
13031303
},
13041304
set(value) {
13051305
this[kPaused] = !!value;
1306-
}
1307-
}
1306+
},
1307+
},
13081308
});
13091309

13101310
// Exposed for testing purposes only.
@@ -1418,6 +1418,6 @@ Readable.wrap = function(src, options) {
14181418
destroy(err, callback) {
14191419
destroyImpl.destroyer(src, err);
14201420
callback(err);
1421-
}
1421+
},
14221422
}).wrap(src);
14231423
};

lib/internal/streams/state.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) {
3232

3333
module.exports = {
3434
getHighWaterMark,
35-
getDefaultHighWaterMark
35+
getDefaultHighWaterMark,
3636
};

lib/internal/streams/transform.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const {
7070

7171
module.exports = Transform;
7272
const {
73-
ERR_METHOD_NOT_IMPLEMENTED
73+
ERR_METHOD_NOT_IMPLEMENTED,
7474
} = require('internal/errors').codes;
7575
const Duplex = require('internal/streams/duplex');
7676
const { getHighWaterMark } = require('internal/streams/state');
@@ -99,7 +99,7 @@ function Transform(options) {
9999
// a "bug" where we check needDrain before calling _write and not after.
100100
// Refs: https://github.com/nodejs/node/pull/32887
101101
// Refs: https://github.com/nodejs/node/pull/35941
102-
writableHighWaterMark: options.writableHighWaterMark || 0
102+
writableHighWaterMark: options.writableHighWaterMark || 0,
103103
};
104104
}
105105

0 commit comments

Comments
 (0)