@angular/router
Advanced tools
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -8,6 +8,6 @@ * License: MIT | ||
| import * as i3 from '@angular/common'; | ||
| import { PlatformNavigation, Location, ɵNavigationAdapterForLocation as _NavigationAdapterForLocation, LOCATION_INITIALIZED, ViewportScroller, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common'; | ||
| import { ViewportScroller, PlatformNavigation, PlatformLocation, Location, ɵNavigationAdapterForLocation as _NavigationAdapterForLocation, LOCATION_INITIALIZED, LocationStrategy, HashLocationStrategy, PathLocationStrategy } from '@angular/common'; | ||
| import * as i0 from '@angular/core'; | ||
| import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideEnvironmentInitializer, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgZone, NgModule } from '@angular/core'; | ||
| import { ROUTER_CONFIGURATION, NavigationEnd, isUrlTree, Router, ActivatedRoute, RouterConfigLoader, IMPERATIVE_NAVIGATION, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, UrlSerializer, NavigationTransitions, HistoryStateManager, ROUTES, afterNextNavigation, StateManager, stringifyEvent, NAVIGATION_ERROR_HANDLER, RoutedComponentInputBinder, INPUT_BINDER, CREATE_VIEW_TRANSITION, createViewTransition, VIEW_TRANSITION_OPTIONS, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './_router-chunk.mjs'; | ||
| import { signal, untracked, inject, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, HostAttributeToken, ɵRuntimeError as _RuntimeError, booleanAttribute, Directive, Attribute, HostBinding, Input, HostListener, EventEmitter, ContentChildren, Output, Injectable, createEnvironmentInjector, InjectionToken, NgZone, EnvironmentInjector, DestroyRef, afterNextRender, ɵpromiseWithResolvers as _promiseWithResolvers, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideEnvironmentInitializer, Injector, ApplicationRef, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, provideAppInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgModule } from '@angular/core'; | ||
| import { ROUTER_CONFIGURATION, NavigationEnd, isUrlTree, Router, ActivatedRoute, RouterConfigLoader, IMPERATIVE_NAVIGATION, UrlSerializer, NavigationTransitions, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, StateManager, RoutesRecognized, BeforeActivateRoutes, NavigationCancel, NavigationError, NavigationCancellationCode, ROUTES, afterNextNavigation, stringifyEvent, NAVIGATION_ERROR_HANDLER, RoutedComponentInputBinder, INPUT_BINDER, CREATE_VIEW_TRANSITION, createViewTransition, VIEW_TRANSITION_OPTIONS, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './_router-chunk.mjs'; | ||
| import { Subject, of, from } from 'rxjs'; | ||
@@ -172,3 +172,3 @@ import { mergeAll, catchError, filter, concatMap, mergeMap } from 'rxjs/operators'; | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -194,3 +194,3 @@ type: RouterLink, | ||
| minVersion: "16.1.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| type: RouterLink, | ||
@@ -227,3 +227,3 @@ isStandalone: true, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -404,3 +404,3 @@ type: RouterLink, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -421,3 +421,3 @@ type: RouterLinkActive, | ||
| minVersion: "14.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| type: RouterLinkActive, | ||
@@ -446,3 +446,3 @@ isStandalone: true, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -498,3 +498,3 @@ type: RouterLinkActive, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -507,3 +507,3 @@ type: PreloadAllModules, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -516,3 +516,3 @@ type: PreloadAllModules, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -533,3 +533,3 @@ type: PreloadAllModules, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -542,3 +542,3 @@ type: NoPreloading, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -551,3 +551,3 @@ type: NoPreloading, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -628,3 +628,3 @@ type: NoPreloading, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -645,3 +645,3 @@ type: RouterPreloader, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -654,3 +654,3 @@ type: RouterPreloader, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -677,6 +677,2 @@ type: RouterPreloader, | ||
| class RouterScroller { | ||
| urlSerializer; | ||
| transitions; | ||
| viewportScroller; | ||
| zone; | ||
| options; | ||
@@ -689,10 +685,10 @@ routerEventsSubscription; | ||
| store = {}; | ||
| constructor(urlSerializer, transitions, viewportScroller, zone, options = {}) { | ||
| this.urlSerializer = urlSerializer; | ||
| this.transitions = transitions; | ||
| this.viewportScroller = viewportScroller; | ||
| this.zone = zone; | ||
| urlSerializer = inject(UrlSerializer); | ||
| zone = inject(NgZone); | ||
| viewportScroller = inject(ViewportScroller); | ||
| transitions = inject(NavigationTransitions); | ||
| constructor(options) { | ||
| this.options = options; | ||
| options.scrollPositionRestoration ||= 'disabled'; | ||
| options.anchorScrolling ||= 'disabled'; | ||
| this.options.scrollPositionRestoration ||= 'disabled'; | ||
| this.options.anchorScrolling ||= 'disabled'; | ||
| } | ||
@@ -724,3 +720,3 @@ init() { | ||
| return this.transitions.events.subscribe(e => { | ||
| if (!(e instanceof Scroll)) return; | ||
| if (!(e instanceof Scroll) || e.scrollBehavior === 'manual') return; | ||
| const instantScroll = { | ||
@@ -745,2 +741,3 @@ behavior: 'instant' | ||
| scheduleScrollEvent(routerEvent, anchor) { | ||
| const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll; | ||
| this.zone.runOutsideAngular(async () => { | ||
@@ -754,3 +751,3 @@ await new Promise(resolve => { | ||
| this.zone.run(() => { | ||
| this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor)); | ||
| this.transitions.events.next(new Scroll(routerEvent, this.lastSource === 'popstate' ? this.store[this.restoredId] : null, anchor, scroll)); | ||
| }); | ||
@@ -765,3 +762,3 @@ }); | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -774,3 +771,3 @@ type: RouterScroller, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -782,3 +779,3 @@ type: RouterScroller | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -790,10 +787,2 @@ type: RouterScroller, | ||
| ctorParameters: () => [{ | ||
| type: UrlSerializer | ||
| }, { | ||
| type: NavigationTransitions | ||
| }, { | ||
| type: i3.ViewportScroller | ||
| }, { | ||
| type: i0.NgZone | ||
| }, { | ||
| type: undefined | ||
@@ -818,10 +807,197 @@ }] | ||
| class NavigationStateManager extends HistoryStateManager { | ||
| class NavigationStateManager extends StateManager { | ||
| injector = inject(EnvironmentInjector); | ||
| navigation = inject(PlatformNavigation); | ||
| inMemoryScrollingEnabled = inject(ROUTER_SCROLLER, { | ||
| optional: true | ||
| }) !== null; | ||
| base = new URL(inject(PlatformLocation).href).origin; | ||
| appRootURL = new URL(this.location.prepareExternalUrl?.('/') ?? '/', this.base).href; | ||
| activeHistoryEntry = this.navigation.currentEntry; | ||
| currentNavigation = {}; | ||
| nonRouterCurrentEntryChangeSubject = new Subject(); | ||
| nonRouterEntryChangeListener; | ||
| get registered() { | ||
| return this.nonRouterEntryChangeListener !== undefined && !this.nonRouterEntryChangeListener.closed; | ||
| } | ||
| constructor() { | ||
| super(); | ||
| const navigateListener = event => { | ||
| this.handleNavigate(event); | ||
| }; | ||
| this.navigation.addEventListener('navigate', navigateListener); | ||
| inject(DestroyRef).onDestroy(() => this.navigation.removeEventListener('navigate', navigateListener)); | ||
| } | ||
| registerNonRouterCurrentEntryChangeListener(listener) { | ||
| return this.location.subscribe(event => { | ||
| if (event['type'] === 'popstate') { | ||
| const state = this.navigation.currentEntry?.getState(); | ||
| listener(event['url'], state, 'popstate'); | ||
| this.activeHistoryEntry = this.navigation.currentEntry; | ||
| this.nonRouterEntryChangeListener = this.nonRouterCurrentEntryChangeSubject.subscribe(({ | ||
| path, | ||
| state | ||
| }) => { | ||
| listener(path, state, 'popstate'); | ||
| }); | ||
| return this.nonRouterEntryChangeListener; | ||
| } | ||
| async handleRouterEvent(e, transition) { | ||
| this.currentNavigation = { | ||
| ...this.currentNavigation, | ||
| routerTransition: transition | ||
| }; | ||
| if (e instanceof NavigationStart) { | ||
| this.updateStateMemento(); | ||
| } else if (e instanceof NavigationSkipped) { | ||
| this.finishNavigation(); | ||
| this.commitTransition(transition); | ||
| } else if (e instanceof RoutesRecognized) { | ||
| if (this.urlUpdateStrategy === 'eager' && !transition.extras.skipLocationChange) { | ||
| this.createNavigationForTransition(transition); | ||
| } | ||
| } else if (e instanceof BeforeActivateRoutes) { | ||
| this.commitTransition(transition); | ||
| if (this.urlUpdateStrategy === 'deferred' && !transition.extras.skipLocationChange) { | ||
| this.createNavigationForTransition(transition); | ||
| } | ||
| } else if (e instanceof NavigationCancel || e instanceof NavigationError) { | ||
| void this.cancel(transition, e); | ||
| } else if (e instanceof NavigationEnd) { | ||
| const { | ||
| resolveHandler, | ||
| removeAbortListener | ||
| } = this.currentNavigation; | ||
| this.currentNavigation = {}; | ||
| removeAbortListener?.(); | ||
| this.activeHistoryEntry = this.navigation.currentEntry; | ||
| afterNextRender({ | ||
| read: () => resolveHandler?.() | ||
| }, { | ||
| injector: this.injector | ||
| }); | ||
| } | ||
| } | ||
| createNavigationForTransition(transition) { | ||
| this.currentNavigation.removeAbortListener?.(); | ||
| const path = this.createBrowserPath(transition); | ||
| this.navigate(path, transition); | ||
| } | ||
| navigate(internalPath, transition) { | ||
| const path = transition.extras.skipLocationChange ? this.navigation.currentEntry.url : this.location.prepareExternalUrl(internalPath); | ||
| const state = { | ||
| ...transition.extras.state, | ||
| navigationId: transition.id | ||
| }; | ||
| const info = { | ||
| ɵrouterInfo: { | ||
| intercept: true | ||
| } | ||
| }; | ||
| const history = this.location.isCurrentPathEqualTo(path) || transition.extras.replaceUrl || transition.extras.skipLocationChange ? 'replace' : 'push'; | ||
| handleResultRejections(this.navigation.navigate(path, { | ||
| state, | ||
| history, | ||
| info | ||
| })); | ||
| } | ||
| finishNavigation() { | ||
| this.currentNavigation?.resolveHandler?.(); | ||
| this.currentNavigation = {}; | ||
| } | ||
| async cancel(transition, cause) { | ||
| this.currentNavigation.rejectNavigateEvent?.(); | ||
| const clearedState = {}; | ||
| this.currentNavigation = clearedState; | ||
| if (cause instanceof NavigationCancel && (cause.code === NavigationCancellationCode.SupersededByNewNavigation || cause.code === NavigationCancellationCode.Redirect)) { | ||
| return; | ||
| } | ||
| const isTraversalReset = this.canceledNavigationResolution === 'computed' && this.navigation.currentEntry.key !== this.activeHistoryEntry.key; | ||
| this.resetInternalState(transition.finalUrl, isTraversalReset); | ||
| if (this.navigation.currentEntry.id === this.activeHistoryEntry.id) { | ||
| return; | ||
| } | ||
| if (cause instanceof NavigationCancel && cause.code !== NavigationCancellationCode.GuardRejected && cause.code !== NavigationCancellationCode.NoDataFromResolver) { | ||
| await Promise.resolve(); | ||
| if (this.currentNavigation !== clearedState) { | ||
| return; | ||
| } | ||
| } | ||
| if (isTraversalReset) { | ||
| handleResultRejections(this.navigation.traverseTo(this.activeHistoryEntry.key, { | ||
| info: { | ||
| ɵrouterInfo: { | ||
| intercept: false | ||
| } | ||
| } | ||
| })); | ||
| } else { | ||
| const internalPath = this.urlSerializer.serialize(this.getCurrentUrlTree()); | ||
| const pathOrUrl = this.location.prepareExternalUrl(internalPath); | ||
| handleResultRejections(this.navigation.navigate(pathOrUrl, { | ||
| state: this.activeHistoryEntry.getState(), | ||
| history: 'replace', | ||
| info: { | ||
| ɵrouterInfo: { | ||
| intercept: false | ||
| } | ||
| } | ||
| })); | ||
| } | ||
| } | ||
| resetInternalState(finalUrl, traversalReset) { | ||
| this.routerState = this.stateMemento.routerState; | ||
| this.currentUrlTree = this.stateMemento.currentUrlTree; | ||
| this.rawUrlTree = traversalReset ? this.stateMemento.rawUrlTree : this.urlHandlingStrategy.merge(this.currentUrlTree, finalUrl ?? this.rawUrlTree); | ||
| } | ||
| handleNavigate(event) { | ||
| if (!event.canIntercept) { | ||
| return; | ||
| } | ||
| const routerInfo = event?.info?.ɵrouterInfo; | ||
| if (routerInfo && !routerInfo.intercept) { | ||
| return; | ||
| } | ||
| const isTriggeredByRouterTransition = !!routerInfo; | ||
| if (!isTriggeredByRouterTransition) { | ||
| this.currentNavigation.routerTransition?.abort(); | ||
| if (!this.registered) { | ||
| this.finishNavigation(); | ||
| return; | ||
| } | ||
| } | ||
| this.currentNavigation = { | ||
| ...this.currentNavigation | ||
| }; | ||
| const abortHandler = () => { | ||
| this.currentNavigation.routerTransition?.abort(); | ||
| }; | ||
| event.signal.addEventListener('abort', abortHandler); | ||
| this.currentNavigation.removeAbortListener = () => event.signal.removeEventListener('abort', abortHandler); | ||
| let scroll = this.inMemoryScrollingEnabled ? 'manual' : this.currentNavigation.routerTransition?.extras.scroll ?? 'after-transition'; | ||
| const interceptOptions = { | ||
| scroll | ||
| }; | ||
| const { | ||
| promise: handlerPromise, | ||
| resolve: resolveHandler, | ||
| reject: rejectHandler | ||
| } = _promiseWithResolvers(); | ||
| this.currentNavigation.resolveHandler = () => { | ||
| this.currentNavigation.removeAbortListener?.(); | ||
| resolveHandler(); | ||
| }; | ||
| this.currentNavigation.rejectNavigateEvent = () => { | ||
| this.currentNavigation.removeAbortListener?.(); | ||
| rejectHandler(); | ||
| }; | ||
| handlerPromise.catch(() => {}); | ||
| interceptOptions.handler = () => handlerPromise; | ||
| event.intercept(interceptOptions); | ||
| if (!isTriggeredByRouterTransition) { | ||
| this.handleNavigateEventTriggeredOutsideRouterAPIs(event); | ||
| } | ||
| } | ||
| handleNavigateEventTriggeredOutsideRouterAPIs(event) { | ||
| const path = event.destination.url.substring(this.appRootURL.length - 1); | ||
| const state = event.destination.getState(); | ||
| this.nonRouterCurrentEntryChangeSubject.next({ | ||
| path, | ||
| state | ||
| }); | ||
@@ -831,6 +1007,6 @@ } | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
| type: NavigationStateManager, | ||
| deps: null, | ||
| deps: [], | ||
| target: i0.ɵɵFactoryTarget.Injectable | ||
@@ -840,3 +1016,3 @@ }); | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -849,3 +1025,3 @@ type: NavigationStateManager, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -858,4 +1034,10 @@ type: NavigationStateManager, | ||
| }] | ||
| }] | ||
| }], | ||
| ctorParameters: () => [] | ||
| }); | ||
| function handleResultRejections(result) { | ||
| result.finished.catch(() => {}); | ||
| result.committed.catch(() => {}); | ||
| return result; | ||
| } | ||
@@ -917,9 +1099,3 @@ function provideRouter(routes, ...features) { | ||
| provide: ROUTER_SCROLLER, | ||
| useFactory: () => { | ||
| const viewportScroller = inject(ViewportScroller); | ||
| const zone = inject(NgZone); | ||
| const transitions = inject(NavigationTransitions); | ||
| const urlSerializer = inject(UrlSerializer); | ||
| return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, options); | ||
| } | ||
| useFactory: () => new RouterScroller(options) | ||
| }]; | ||
@@ -1145,3 +1321,3 @@ return routerFeature(4, providers); | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -1154,3 +1330,3 @@ type: RouterModule, | ||
| minVersion: "14.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -1163,3 +1339,3 @@ type: RouterModule, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -1171,3 +1347,3 @@ type: RouterModule | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -1189,10 +1365,7 @@ type: RouterModule, | ||
| const viewportScroller = inject(ViewportScroller); | ||
| const zone = inject(NgZone); | ||
| const config = inject(ROUTER_CONFIGURATION); | ||
| const transitions = inject(NavigationTransitions); | ||
| const urlSerializer = inject(UrlSerializer); | ||
| if (config.scrollOffset) { | ||
| viewportScroller.setOffset(config.scrollOffset); | ||
| } | ||
| return new RouterScroller(urlSerializer, transitions, viewportScroller, zone, config); | ||
| return new RouterScroller(config); | ||
| } | ||
@@ -1199,0 +1372,0 @@ }; |
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -31,5 +31,5 @@ * License: MIT | ||
| const VERSION = /* @__PURE__ */new Version('21.0.1'); | ||
| const VERSION = /* @__PURE__ */new Version('21.1.0-next.0'); | ||
| export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve }; | ||
| //# sourceMappingURL=router.mjs.map |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"router.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/utils/functional_guards.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...params);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.0.1');\n"],"names":["mapToCanMatch","providers","map","provider","params","inject","canMatch","mapToCanActivate","canActivate","mapToCanActivateChild","canActivateChild","mapToCanDeactivate","canDeactivate","mapToResolve","resolve","VERSION","Version"],"mappings":";;;;;;;;;;;;;;AAgCM,SAAUA,aAAaA,CAACC,SAAgC,EAAA;EAC5D,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACG,QAAQ,CAAC,GAAGF,MAAM,CAAC,CACzC;AACH;AAWM,SAAUG,gBAAgBA,CAACN,SAAmC,EAAA;EAClE,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACK,WAAW,CAAC,GAAGJ,MAAM,CAAC,CAC5C;AACH;AAUM,SAAUK,qBAAqBA,CACnCR,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACO,gBAAgB,CAAC,GAAGN,MAAM,CAAC,CACjD;AACH;AAUM,SAAUO,kBAAkBA,CAChCV,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACS,aAAa,CAAC,GAAGR,MAAM,CAAC,CAC9C;AACH;AAUM,SAAUS,YAAYA,CAAIV,QAA0B,EAAA;AACxD,EAAA,OAAO,CAAC,GAAGC,MAAM,KAAKC,MAAM,CAACF,QAAQ,CAAC,CAACW,OAAO,CAAC,GAAGV,MAAM,CAAC;AAC3D;;ACpFO,MAAMW,OAAO,kBAAmB,IAAIC,OAAO,CAAC,mBAAmB;;;;"} | ||
| {"version":3,"file":"router.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/utils/functional_guards.ts","../../../../../darwin_arm64-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...params);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('21.1.0-next.0');\n"],"names":["mapToCanMatch","providers","map","provider","params","inject","canMatch","mapToCanActivate","canActivate","mapToCanActivateChild","canActivateChild","mapToCanDeactivate","canDeactivate","mapToResolve","resolve","VERSION","Version"],"mappings":";;;;;;;;;;;;;;AAgCM,SAAUA,aAAaA,CAACC,SAAgC,EAAA;EAC5D,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACG,QAAQ,CAAC,GAAGF,MAAM,CAAC,CACzC;AACH;AAWM,SAAUG,gBAAgBA,CAACN,SAAmC,EAAA;EAClE,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACK,WAAW,CAAC,GAAGJ,MAAM,CAAC,CAC5C;AACH;AAUM,SAAUK,qBAAqBA,CACnCR,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACO,gBAAgB,CAAC,GAAGN,MAAM,CAAC,CACjD;AACH;AAUM,SAAUO,kBAAkBA,CAChCV,SAAwC,EAAA;EAExC,OAAOA,SAAS,CAACC,GAAG,CACjBC,QAAQ,IACP,CAAC,GAAGC,MAAM,KACRC,MAAM,CAACF,QAAQ,CAAC,CAACS,aAAa,CAAC,GAAGR,MAAM,CAAC,CAC9C;AACH;AAUM,SAAUS,YAAYA,CAAIV,QAA0B,EAAA;AACxD,EAAA,OAAO,CAAC,GAAGC,MAAM,KAAKC,MAAM,CAACF,QAAQ,CAAC,CAACW,OAAO,CAAC,GAAGV,MAAM,CAAC;AAC3D;;ACpFO,MAAMW,OAAO,kBAAmB,IAAIC,OAAO,CAAC,mBAAmB;;;;"} |
+11
-11
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -36,3 +36,3 @@ * License: MIT | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -45,3 +45,3 @@ type: RouterTestingModule, | ||
| minVersion: "14.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -53,3 +53,3 @@ type: RouterTestingModule, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -67,3 +67,3 @@ type: RouterTestingModule, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -104,3 +104,3 @@ type: RouterTestingModule, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -113,3 +113,3 @@ type: RootFixtureService, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -122,3 +122,3 @@ type: RootFixtureService, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -142,3 +142,3 @@ type: RootFixtureService, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -151,3 +151,3 @@ type: RootCmp, | ||
| minVersion: "14.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| type: RootCmp, | ||
@@ -177,3 +177,3 @@ isStandalone: true, | ||
| minVersion: "12.0.0", | ||
| version: "21.0.1", | ||
| version: "21.1.0-next.0", | ||
| ngImport: i0, | ||
@@ -180,0 +180,0 @@ type: RootCmp, |
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
+7
-4
| { | ||
| "name": "@angular/router", | ||
| "version": "21.0.1", | ||
| "version": "21.1.0-next.0", | ||
| "description": "Angular - the routing library", | ||
@@ -26,6 +26,9 @@ "keywords": [ | ||
| }, | ||
| "devDependencies": { | ||
| "@types/dom-navigation": "^1.0.5" | ||
| }, | ||
| "peerDependencies": { | ||
| "@angular/core": "21.0.1", | ||
| "@angular/common": "21.0.1", | ||
| "@angular/platform-browser": "21.0.1", | ||
| "@angular/core": "21.1.0-next.0", | ||
| "@angular/common": "21.1.0-next.0", | ||
| "@angular/platform-browser": "21.1.0-next.0", | ||
| "rxjs": "^6.5.3 || ^7.4.0" | ||
@@ -32,0 +35,0 @@ }, |
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
| /** | ||
| * @license Angular v21.0.1 | ||
| * @license Angular v21.1.0-next.0 | ||
| * (c) 2010-2025 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
1215891
2.87%11840
1.82%1
Infinity%1
Infinity%