scratch-sb1-converter
Version:
Scratch 1 (.sb) to Scratch 2 (.sb2) conversion library for Scratch 3.0
24 lines (19 loc) • 451 B
JavaScript
/**
* A `scratch-sb1-converter` assertion.
*/
class AssertionError extends Error {}
/**
* A `scratch-sb1-converter` validation error.
*/
class ValidationError extends AssertionError {}
const assert = function (test, message) {
if (!test) throw new AssertionError(message);
};
assert.validate = function (test, message) {
if (!test) throw new ValidationError(message);
};
export {
assert,
AssertionError,
ValidationError
};