UNPKG

@sigi/ssr

Version:

Server side rendering support for sigi framework

14 lines 539 B
import { match as matchPath } from 'path-to-regexp'; import { SKIP_SYMBOL } from './run'; export function match(routers, pathFactory) { return function (payloadGetter) { return function payloadGetterWithMatch(ctx, skip) { var requestPath = pathFactory(ctx); if (requestPath && routers.some(function (router) { return matchPath(router)(requestPath); })) { return payloadGetter(ctx, skip); } return SKIP_SYMBOL; }; }; } //# sourceMappingURL=match.js.map