UNPKG

accelerator-core

Version:

[![Build Status](https://travis-ci.org/furkleindustries/accelerator-core.svg?branch=master)](https://travis-ci.org/furkleindustries/accelerator-core)

22 lines (18 loc) 484 B
export namespace Debug { // tslint:disable no-string-throw export function AssertType<T>(variable: any, type: new () => T, message: string): void | never { Assert(variable instanceof type, message); } export function Assert(condition: boolean, message?: string): void | never { if (!condition) { // tslint:disable:no-console if (typeof message !== 'undefined') { console.warn(message); } if (console.trace) { console.trace(); } throw ''; } } }