as<D extends Destination> method

D as<D extends Destination>()

Cast current into type D. Throws if the cast fails. Useful when confident about current's type.

Implementation

D as<D extends Destination>() => current as D;