node/lib/internal/assert.js
Rich Trott 5d609bb11c assert: create internal/assert micro-module
For use in built-in modules that could benefit from `assert()` without
having to load the entire module (unless an AssertionError actually
occurs): lib/internal/assert.js.

PR-URL: https://github.com/nodejs/node/pull/25956
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
2019-02-08 00:01:09 -08:00

10 lines
136 B
JavaScript

'use strict';
function assert(value, message) {
if (!value) {
require('assert')(value, message);
}
}
module.exports = assert;