case (value) { when { constructor: Buffer } -> console.log("It's a Buffer!") }
However I think my point stands that javascript has runtime conceptions of types that go beyond duck typing.