mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
9 lines
245 B
TypeScript
9 lines
245 B
TypeScript
import { AssertionError } from './error'
|
|
|
|
export default function<T> (predicate: T | null | undefined, message?: string) {
|
|
if (!predicate) {
|
|
message = message || `expect ${predicate} to be true`
|
|
throw new AssertionError(message)
|
|
}
|
|
}
|