mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 20:30:39 -07:00
refactor: use assert, fix: respect to express settings.views, close #16
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
const AssertionError = require('./error.js').AssertionError;
|
||||
|
||||
function assert(predicate, message) {
|
||||
if (!predicate) {
|
||||
if (message instanceof Error) {
|
||||
throw message;
|
||||
}
|
||||
var message = message || `expect ${predicate} to be true`;
|
||||
throw new AssertionError(message);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = assert;
|
||||
Reference in New Issue
Block a user