tooty
Version:
Simple agnostic message router for node
32 lines (24 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var RoutingResult = (function () {
function RoutingResult(routeSearch, matchedRoute) {
_classCallCheck(this, RoutingResult);
this.routeSearch = routeSearch;
this.matchedRoute = matchedRoute;
this.handler = matchedRoute && matchedRoute.handler;
}
_createClass(RoutingResult, [{
key: "isSuccess",
value: function isSuccess() {
// TODO: There's probably a better check for a route's success.
return this.matchedRoute !== null;
}
}]);
return RoutingResult;
})();
exports["default"] = RoutingResult;
module.exports = exports["default"];