rest-chronicle
Version:
autodocumentate rest api
26 lines (25 loc) • 625 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PeerDependency = void 0;
const PeerDependency = exports.PeerDependency = {
X: class PeerDependencyX extends Error {
constructor(error) {
super(error.message);
this.name = 'MISSING_PEER_DEPENDENCY';
this.original = error;
}
},
load(moduleName) {
try {
// eslint-disable-next-line security/detect-non-literal-require
return require(moduleName);
} catch (error) {
return new this.X(error);
}
},
check(module) {
if (module instanceof this.X) throw module.original;
}
};