UNPKG

oidc-client-rx

Version:

ReactiveX enhanced OIDC and OAuth2 protocol support for browser-based JavaScript applications

27 lines (26 loc) 1.24 kB
import { Injectable } from "@outposts/injection-js"; function _ts_decorate(decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; } class ClosestMatchingRouteService { getConfigIdForClosestMatchingRoute(route, configurations) { for (const config of configurations){ const { secureRoutes } = config; for (const configuredRoute of secureRoutes ?? [])if (route.startsWith(configuredRoute)) return { matchingRoute: configuredRoute, matchingConfig: config }; } return { matchingRoute: null, matchingConfig: null }; } } ClosestMatchingRouteService = _ts_decorate([ Injectable() ], ClosestMatchingRouteService); export { ClosestMatchingRouteService };