@loaders.gl/loader-utils
Version:
Framework-independent loaders for 3D graphics formats
10 lines (9 loc) • 306 B
text/typescript
/**
* Throws an `Error` with the optional `message` if `condition` is falsy
* @note Replacement for the external assert method to reduce bundle size
*/
export function assert(condition: any, message?: string): void {
if (!condition) {
throw new Error(message || 'loader assertion failed.');
}
}