UNPKG

@inversifyjs/container

Version:

InversifyJs container

20 lines 723 B
const isAppErrorSymbol = Symbol.for('@inversifyjs/container/InversifyContainerError'); export class InversifyContainerError extends Error { [isAppErrorSymbol]; kind; constructor(kind, message, options) { super(message, options); this[isAppErrorSymbol] = true; this.kind = kind; } static is(value) { return (typeof value === 'object' && value !== null && value[isAppErrorSymbol] === true); } static isErrorOfKind(value, kind) { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition return InversifyContainerError.is(value) && value.kind === kind; } } //# sourceMappingURL=InversifyContainerError.js.map