/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v20.20.1
lib/internal/assert.js
25 строк
474 B
Rich Trott
benchmark,doc,lib,test: prepare for padding lint rule
30 ноя 2019, 17:28
30 ноя 2019, 17:28
359766b
Код
Авторство
О чём код?
'use strict'; let error; function lazyError() { if (!error) { error = require('internal/errors').codes.ERR_INTERNAL_ASSERTION; } return error; } function assert(value, message) { if (!value) { const ERR_INTERNAL_ASSERTION = lazyError(); throw new ERR_INTERNAL_ASSERTION(message); } } function fail(message) { const ERR_INTERNAL_ASSERTION = lazyError(); throw new ERR_INTERNAL_ASSERTION(message); } assert.fail = fail; module.exports = assert;