import type { Assert } from './prelude.js' import { inspect } from 'util' const instance = // eslint-disable-next-line @typescript-eslint/no-explicit-any any>(class_: T): Assert> => value => { if (!(value instanceof class_)) { throw new TypeError(`Expected ${inspect(value)} to be instance of ${inspect(class_)}.`) } return value as InstanceType } export default instance