-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update write/end types to comply with NodeJS.WritableStream
- Loading branch information
Showing
4 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,6 +74,7 @@ | |
"node": ">=16 || 14 >=14.17" | ||
}, | ||
"tap": { | ||
"typecheck": true, | ||
"include": [ | ||
"test/*.ts" | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Minipass } from '../src/index.js' | ||
|
||
let tester: NodeJS.WritableStream | ||
tester = new Minipass() | ||
tester = new Minipass<Buffer>() | ||
tester = new Minipass<Buffer | string>() | ||
tester = new Minipass<Buffer, Minipass.ContiguousData>() | ||
tester = new Minipass<string>({ encoding: 'hex' }) | ||
tester = new Minipass<string, Buffer | string>({ encoding: 'hex' }) | ||
tester = new Minipass<Buffer, string>() | ||
|
||
// We expect this one to be an error, because the NodeJS.WritableStream | ||
// does not allow objectMode streams, so it would be a problem to use an | ||
// OM minipass in contexts where a NodeJS.WritableStream is expected. | ||
//@ts-expect-error | ||
tester = new Minipass<{ a: 1 }>({ objectMode: true }) | ||
|
||
// so the linter doesn't complain about unused variable | ||
tester | ||
|
||
import { pass } from 'tap' | ||
pass(`just making sure TS doesn't complain`) |