import { checkUnknown } from 'type-plus' ; class ErrorA extends Error { } class ErrorB extends Error { } try { throw new ErrorA ( ) ; } catch ( e ) { if ( checkUnknown ( e , ErrorA ) ) { } else if ( checkUnknown ( e , ErrorB ) ) { } else { } }