mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-19 07:13:56 +00:00
14 lines
324 B
TypeScript
14 lines
324 B
TypeScript
|
/**
|
||
|
* 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 {
|
||
|
// tslint:disable-next-line: no-console
|
||
|
console.log(...args);
|
||
|
}
|