UNPKG

extendo-error

Version:

Safely and simply extend native Error with prototype chaining support

38 lines (37 loc) 1.28 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var extendo_error_1 = require("../src/extendo-error"); var AnotherChildError = (function (_super) { __extends(AnotherChildError, _super); function AnotherChildError() { var _this = _super.apply(this, arguments) || this; _this.aMagicNumber = 3; _this.theWord = "bird"; return _this; } Object.defineProperty(AnotherChildError.prototype, "theAnswer", { get: function () { return 42; }, enumerable: true, configurable: true }); Object.defineProperty(AnotherChildError.prototype, "thisMuch", { get: function () { return true; }, enumerable: true, configurable: true }); AnotherChildError.prototype.doSomething = function () { }; AnotherChildError.prototype.doSomethingElse = function () { }; return AnotherChildError; }(extendo_error_1.default)); Object.defineProperty(exports, "__esModule", { value: true }); exports.default = AnotherChildError;