amis-rpc-design/node_modules/nullthrows/nullthrows.js

16 lines
384 B
JavaScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
'use strict';
function nullthrows(x, message) {
if (x != null) {
return x;
}
var error = new Error(message !== undefined ? message : 'Got unexpected ' + x);
error.framesToPop = 1; // Skip nullthrows's own stack frame.
throw error;
}
module.exports = nullthrows;
module.exports.default = nullthrows;
Object.defineProperty(module.exports, '__esModule', {value: true});