UNPKG

lazy-widgets

Version:

Typescript retained mode GUI for the HTML canvas API

17 lines 497 B
/** * Creates a new validator function which checks whether an input value is an * instance of a given class. Doesn't stop the validator chain. * * @category XML */ export function makeInstanceOfValidator(clazz) { return (value) => { if (value instanceof clazz) { return [value, false]; } else { throw new Error('Invalid instance; not an instance of the wanted class'); } }; } //# sourceMappingURL=makeInstanceOfValidator.js.map