Skip to content

Commit 63e3a62

Browse files
addaleaxtargos
authored andcommitted
stream: add writableCorked to Duplex
PR-URL: #29053 Reviewed-By: Anna Henningsen <[email protected]>
1 parent 6a8a33c commit 63e3a62

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/_stream_duplex.js

+10
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,16 @@ Object.defineProperty(Duplex.prototype, 'writableFinished', {
108108
}
109109
});
110110

111+
Object.defineProperty(Duplex.prototype, 'writableCorked', {
112+
// Making it explicit this property is not enumerable
113+
// because otherwise some prototype manipulation in
114+
// userland will fail
115+
enumerable: false,
116+
get() {
117+
return this._writableState ? this._writableState.corked : 0;
118+
}
119+
});
120+
111121
Object.defineProperty(Duplex.prototype, 'writableEnded', {
112122
// Making it explicit this property is not enumerable
113123
// because otherwise some prototype manipulation in

0 commit comments

Comments
 (0)