GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — stream: avoid function call where possible · cspotcode/node@20347d5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/streams
    • utils.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/streams/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/streams/utils.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,17 +118,19 @@ function isReadableFinished(stream, strict) {
118118

119119
function isReadable(stream) {
120120
if (stream && stream[kIsReadable] != null) return stream[kIsReadable];
121-
const r = isReadableNodeStream(stream);
122121
if (typeof stream?.readable !== 'boolean') return null;
123122
if (isDestroyed(stream)) return false;
124-
return r && stream.readable && !isReadableFinished(stream);
123+
return isReadableNodeStream(stream) &&
124+
stream.readable &&
125+
!isReadableFinished(stream);
125126
}
126127

127128
function isWritable(stream) {
128-
const r = isWritableNodeStream(stream);
129129
if (typeof stream?.writable !== 'boolean') return null;
130130
if (isDestroyed(stream)) return false;
131-
return r && stream.writable && !isWritableEnded(stream);
131+
return isWritableNodeStream(stream) &&
132+
stream.writable &&
133+
!isWritableEnded(stream);
132134
}
133135

134136
function isFinished(stream, opts) {

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.