Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4bf3e1e

Browse filesBrowse files
committed
stream: remove duplicated utility
Signed-off-by: Antoine du Hamel <duhamelantoine1995@gmail.com> PR-URL: #63031 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 87adb34 commit 4bf3e1e
Copy full SHA for 4bf3e1e

5 files changed

+33-51Lines changed: 33 additions & 51 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/webstreams/queuingstrategies.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/queuingstrategies.js
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const {
1919

2020
const {
2121
customInspect,
22+
getNonWritablePropertyDescriptor,
2223
} = require('internal/webstreams/util');
2324

2425
const {
@@ -46,14 +47,6 @@ const byteSizeFunction = ObjectDefineProperty(
4647
);
4748
const countSizeFunction = ObjectDefineProperty(() => 1, 'name', nameDescriptor);
4849

49-
const getNonWritablePropertyDescriptor = (value) => {
50-
return {
51-
__proto__: null,
52-
configurable: true,
53-
value,
54-
};
55-
};
56-
5750
/**
5851
* @type {QueuingStrategy}
5952
*/
Collapse file

‎lib/internal/webstreams/readablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/readablestream.js
+6-13Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,16 @@ const {
106106
enqueueValueWithSize,
107107
extractHighWaterMark,
108108
extractSizeAlgorithm,
109-
lazyTransfer,
109+
getNonWritablePropertyDescriptor,
110110
isBrandCheck,
111-
resetQueue,
112-
setPromiseHandled,
111+
kState,
112+
kType,
113+
lazyTransfer,
113114
nonOpCancel,
114115
nonOpPull,
115116
nonOpStart,
116-
kType,
117-
kState,
117+
resetQueue,
118+
setPromiseHandled,
118119
} = require('internal/webstreams/util');
119120

120121
const {
@@ -171,14 +172,6 @@ function lazyReadableReleasingError() {
171172
return releasingError;
172173
}
173174

174-
const getNonWritablePropertyDescriptor = (value) => {
175-
return {
176-
__proto__: null,
177-
configurable: true,
178-
value,
179-
};
180-
};
181-
182175
/**
183176
* @typedef {import('../abort_controller').AbortSignal} AbortSignal
184177
* @typedef {import('./queuingstrategies').QueuingStrategy} QueuingStrategy
Collapse file

‎lib/internal/webstreams/transformstream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/transformstream.js
+3-9Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ const {
4747
customInspect,
4848
extractHighWaterMark,
4949
extractSizeAlgorithm,
50+
getNonWritablePropertyDescriptor,
5051
isBrandCheck,
51-
nonOpFlush,
52-
kType,
5352
kState,
53+
kType,
5454
nonOpCancel,
55+
nonOpFlush,
5556
} = require('internal/webstreams/util');
5657

5758
const {
@@ -72,13 +73,6 @@ const {
7273
const assert = require('internal/assert');
7374

7475
const kSkipThrow = Symbol('kSkipThrow');
75-
const getNonWritablePropertyDescriptor = (value) => {
76-
return {
77-
__proto__: null,
78-
configurable: true,
79-
value,
80-
};
81-
};
8276

8377
/**
8478
* @typedef {import('./queuingstrategies').QueuingStrategy
Collapse file

‎lib/internal/webstreams/util.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/util.js
+16-7Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ const AsyncIterator = {
5252
return: undefined,
5353
};
5454

55+
const getNonWritablePropertyDescriptor = (value) => {
56+
return {
57+
__proto__: null,
58+
configurable: true,
59+
value,
60+
};
61+
};
62+
5563
function extractHighWaterMark(value, defaultHWM) {
5664
if (value === undefined) return defaultHWM;
5765
value = +value;
@@ -204,25 +212,26 @@ module.exports = {
204212
ArrayBufferViewGetByteOffset,
205213
AsyncIterator,
206214
canCopyArrayBuffer,
207-
createPromiseCallback,
208215
cloneAsUint8Array,
209216
copyArrayBuffer,
217+
createPromiseCallback,
210218
customInspect,
211219
dequeueValue,
212220
enqueueValueWithSize,
213221
extractHighWaterMark,
214222
extractSizeAlgorithm,
215-
lazyTransfer,
223+
getNonWritablePropertyDescriptor,
216224
isBrandCheck,
217225
isPromisePending,
218-
peekQueueValue,
219-
resetQueue,
220-
setPromiseHandled,
226+
kState,
227+
kType,
228+
lazyTransfer,
221229
nonOpCancel,
222230
nonOpFlush,
223231
nonOpPull,
224232
nonOpStart,
225233
nonOpWrite,
226-
kType,
227-
kState,
234+
peekQueueValue,
235+
resetQueue,
236+
setPromiseHandled,
228237
};
Collapse file

‎lib/internal/webstreams/writablestream.js‎

Copy file name to clipboardExpand all lines: lib/internal/webstreams/writablestream.js
+7-14Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,18 @@ const {
6161
enqueueValueWithSize,
6262
extractHighWaterMark,
6363
extractSizeAlgorithm,
64-
lazyTransfer,
64+
getNonWritablePropertyDescriptor,
6565
isBrandCheck,
6666
isPromisePending,
67-
peekQueueValue,
68-
resetQueue,
69-
setPromiseHandled,
67+
kState,
68+
kType,
69+
lazyTransfer,
7070
nonOpCancel,
7171
nonOpStart,
7272
nonOpWrite,
73-
kType,
74-
kState,
73+
peekQueueValue,
74+
resetQueue,
75+
setPromiseHandled,
7576
} = require('internal/webstreams/util');
7677

7778
const {
@@ -106,14 +107,6 @@ function lazyWritableReleasedError() {
106107
return releasedError;
107108
}
108109

109-
const getNonWritablePropertyDescriptor = (value) => {
110-
return {
111-
__proto__: null,
112-
configurable: true,
113-
value,
114-
};
115-
};
116-
117110
/**
118111
* @typedef {import('../abort_controller').AbortSignal} AbortSignal
119112
* @typedef {import('./queuingstrategies').QueuingStrategy

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.