mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-28 06:53:42 +08:00
15 lines
506 B
TypeScript
15 lines
506 B
TypeScript
// A class without a constructor that extends a stream class inherits the
|
|
// runtime constructor, which takes no arguments here. Passing arguments
|
|
// through the class's value reports at the first argument, as direct
|
|
// construction does.
|
|
import { Transform } from "node:stream";
|
|
|
|
class Upper extends Transform {}
|
|
const registry = { upper: Upper };
|
|
const upper = new registry.upper({ objectMode: true });
|
|
upper.destroy();
|
|
|
|
const Kind = Upper;
|
|
const other = new Kind({ highWaterMark: 4 });
|
|
other.destroy();
|