Skip to content

Commit 563e161

Browse files
Rebuild
1 parent 567da2e commit 563e161

21 files changed

+330
-293
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
// Ported from https://github.com/mafintosh/end-of-stream with
2+
// permission from the author, Mathias Buus (@mafintosh).
3+
4+
'use strict'
5+
16
/* replacement start */
27

38
const process = require('process/')
49

510
/* replacement end */
6-
// Ported from https://github.com/mafintosh/end-of-stream with
7-
// permission from the author, Mathias Buus (@mafintosh).
811

9-
;('use strict')
1012
const { AbortError, codes } = require('../../ours/errors')
1113
const { ERR_INVALID_ARG_TYPE, ERR_STREAM_PREMATURE_CLOSE } = codes
1214
const { kEmptyObject, once } = require('../../ours/util')

lib/internal/streams/readable.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* replacement start */
2-
3-
const process = require('process/')
4-
5-
/* replacement end */
61
// Copyright Joyent, Inc. and other Node contributors.
72
//
83
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +19,14 @@ const process = require('process/')
2419
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2520
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2621

27-
;('use strict')
22+
'use strict'
23+
24+
/* replacement start */
25+
26+
const process = require('process/')
27+
28+
/* replacement end */
29+
2830
const {
2931
ArrayPrototypeIndexOf,
3032
NumberIsInteger,

lib/internal/streams/utils.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ function isReadableNodeStream(obj, strict = false) {
3030
) // Writable has .pipe.
3131
)
3232
}
33-
3433
function isWritableNodeStream(obj) {
3534
var _obj$_writableState
3635
return !!(
@@ -45,7 +44,6 @@ function isWritableNodeStream(obj) {
4544
) // Duplex
4645
)
4746
}
48-
4947
function isDuplexNodeStream(obj) {
5048
return !!(
5149
obj &&

lib/internal/streams/writable.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* replacement start */
2-
3-
const process = require('process/')
4-
5-
/* replacement end */
61
// Copyright Joyent, Inc. and other Node contributors.
72
//
83
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,7 +23,14 @@ const process = require('process/')
2823
// Implement an async ._write(chunk, encoding, cb), and it'll handle all
2924
// the drain event emission and buffering.
3025

31-
;('use strict')
26+
'use strict'
27+
28+
/* replacement start */
29+
30+
const process = require('process/')
31+
32+
/* replacement end */
33+
3234
const {
3335
ArrayPrototypeSlice,
3436
Error,

lib/ours/errors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,8 @@ E(
311311
received = addNumericalSeparator(String(input))
312312
} else if (typeof input === 'bigint') {
313313
received = String(input)
314-
if (input > 2n ** 32n || input < -(2n ** 32n)) {
314+
const limit = BigInt(2) ** BigInt(32)
315+
if (input > limit || input < -limit) {
315316
received = addNumericalSeparator(received)
316317
}
317318
received += 'n'

lib/ours/primordials.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,6 @@ module.exports = {
102102
TypedArrayPrototypeSet(self, buf, len) {
103103
return self.set(buf, len)
104104
},
105-
Boolean: Boolean,
105+
Boolean,
106106
Uint8Array
107107
}

lib/ours/util.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
'use strict'
22

33
const bufferModule = require('buffer')
4+
const {
5+
codes: { ERR_INVALID_ARG_TYPE }
6+
} = require('./errors')
47
const { kResistStopPropagation, SymbolDispose } = require('./primordials')
58
const AbortSignal = globalThis.AbortSignal || require('abort-controller').AbortSignal
69
const AbortController = globalThis.AbortController || require('abort-controller').AbortController
@@ -24,7 +27,9 @@ const validateAbortSignal = (signal, name) => {
2427
}
2528
}
2629
const validateFunction = (value, name) => {
27-
if (typeof value !== 'function') throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)
30+
if (typeof value !== 'function') {
31+
throw new ERR_INVALID_ARG_TYPE(name, 'Function', value)
32+
}
2833
}
2934

3035
// This is a simplified version of AggregateError

lib/stream.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* replacement start */
2-
3-
const { Buffer } = require('buffer')
4-
5-
/* replacement end */
61
// Copyright Joyent, Inc. and other Node contributors.
72
//
83
// Permission is hereby granted, free of charge, to any person obtaining a
@@ -24,7 +19,14 @@ const { Buffer } = require('buffer')
2419
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2520
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2621

27-
;('use strict')
22+
'use strict'
23+
24+
/* replacement start */
25+
26+
const { Buffer } = require('buffer')
27+
28+
/* replacement end */
29+
2830
const { ObjectDefineProperty, ObjectKeys, ReflectApply } = require('./ours/primordials')
2931
const {
3032
promisify: { custom: customPromisify }

test/browser/test-stream2-readable-wrap.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ module.exports = function (test) {
4747
old.emit('data', item)
4848
// console.log('after emit', chunks, flowing);
4949
}
50-
5150
if (chunks <= 0) {
5251
oldEnded = true
5352
// console.log('old end', chunks, flowing);

test/common/fixtures.mjs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
1-
import fixtures from './fixtures.js';
1+
import fixtures from './fixtures.js'
22

3-
const {
4-
fixturesDir,
5-
path,
6-
fileURL,
7-
readSync,
8-
readKey,
9-
} = fixtures;
3+
const { fixturesDir, path, fileURL, readSync, readKey } = fixtures
104

11-
export {
12-
fixturesDir,
13-
path,
14-
fileURL,
15-
readSync,
16-
readKey,
17-
};
5+
export { fixturesDir, path, fileURL, readSync, readKey }

0 commit comments

Comments
 (0)