Tone.js/Tone/core/util/Debug.ts

14 lines
322 B
TypeScript
Raw Normal View History

/**
2019-09-14 20:39:18 +00:00
* Assert that the statement is true, otherwise invoke an error with the given message.
*/
export function assert(statement: boolean, error: string): void {
if (!statement) {
throw new Error(error);
}
}
export function log(...args: any[]): void {
// eslint-disable-next-line no-console
console.log(...args);
}