UNPKG

@itrocks/route

Version:

Domain-driven route manager with automatic generation, decorators, and static routes

14 lines 660 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isDestination = isDestination; exports.resolveDestination = resolveDestination; const app_dir_1 = require("@itrocks/app-dir"); const class_type_1 = require("@itrocks/class-type"); function isDestination(destination) { return typeof destination === 'string'; } function resolveDestination(destination) { const module = require((destination[0] === '/') ? (app_dir_1.appDir + destination) : destination); return module.default ?? Object.values(module).find(destination => (0, class_type_1.isAnyFunctionOrType)(destination)); } //# sourceMappingURL=destination.js.map