diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f6ea9c1d..91ce2afcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: fail-fast: false matrix: os: [macOS-latest, windows-latest, ubuntu-latest] - node-version: [14, 16, 18, 19, 20] + node-version: [14, 16, 18, 19, 20, 21] exclude: - os: windows-latest node-version: 14 diff --git a/lib/proto.js b/lib/proto.js index 624f809ab..b82fd0c26 100644 --- a/lib/proto.js +++ b/lib/proto.js @@ -226,7 +226,7 @@ function flush (cb) { const stream = this[streamSym] - if ('flush' in stream) { + if (typeof stream.flush === 'function') { stream.flush(cb || noop) } else if (cb) cb() }