Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

router_js

Package Overview
Dependencies
Maintainers
7
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

router_js - npm Package Compare versions

Comparing version 8.0.0 to 8.0.1

2

dist/cjs/index.d.ts
export { default } from './router';
export { default as InternalTransition, PublicTransition as Transition, logAbort, STATE_SYMBOL, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, } from './transition';
export { default as TransitionState, TransitionError } from './transition-state';
export { default as InternalRouteInfo, IModel, ModelFor, RouteInfo, Route } from './route-info';
export { default as InternalRouteInfo, IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info';

@@ -8,3 +8,3 @@ import RouteRecognizer, { MatchCallback } from 'route-recognizer';

import TransitionState, { TransitionError } from './transition-state';
import { ChangeList, QueryParamsContainer } from './utils';
import { ChangeList, ModelsAndQueryParams } from './utils';
export interface SerializerFunc<T extends IModel> {

@@ -228,6 +228,6 @@ (model: T, params: string[]): Dict<unknown>;

*/
generate(routeName: string, ...args: ModelFor<R>[]): string;
generate(routeName: string, ...args: ModelsAndQueryParams<ModelFor<R>>): string;
applyIntent(routeName: string, contexts: ModelFor<R>[]): TransitionState<R>;
isActiveIntent(routeName: string, contexts: ModelFor<R>[], queryParams?: Dict<unknown> | null, _state?: TransitionState<R>): boolean;
isActive(routeName: string, ...args: ModelFor<R>[] | [...ModelFor<R>[], QueryParamsContainer]): boolean;
isActive(routeName: string, ...args: ModelsAndQueryParams<ModelFor<R>>): boolean;
trigger(name: string, ...args: any[]): void;

@@ -234,0 +234,0 @@ }

@@ -29,6 +29,3 @@ "use strict";

applyToState(oldState, isIntermediate) {
// TODO: WTF fix me
let partitionedArgs = (0, _utils.extractQueryParams)([this.name].concat(this.contexts)),
pureArgs = partitionedArgs[0],
handlers = this.router.recognizer.handlersFor(pureArgs[0]);
let handlers = this.router.recognizer.handlersFor(this.name);
let targetRouteName = handlers[handlers.length - 1].handler;

@@ -35,0 +32,0 @@ return this.applyToHandlers(oldState, handlers, targetRouteName, isIntermediate, false);

@@ -11,2 +11,3 @@ import { QueryParams } from 'route-recognizer';

export declare function merge(hash: Dict<unknown>, other?: Dict<unknown>): void;
export declare type ModelsAndQueryParams<T> = T[] | [...T[], QueryParamsContainer];
/**

@@ -17,3 +18,3 @@ @private

**/
export declare function extractQueryParams<T>(array: T[] | [...T[], QueryParamsContainer]): [T[], QueryParams | null];
export declare function extractQueryParams<T>(array: ModelsAndQueryParams<T>): [T[], QueryParams | null];
export declare type QueryParamsContainer = {

@@ -20,0 +21,0 @@ queryParams: QueryParams;

export { default } from './router';
export { default as InternalTransition, PublicTransition as Transition, logAbort, STATE_SYMBOL, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, } from './transition';
export { default as TransitionState, TransitionError } from './transition-state';
export { default as InternalRouteInfo, IModel, ModelFor, RouteInfo, Route } from './route-info';
export { default as InternalRouteInfo, IModel, ModelFor, Route, RouteInfo, RouteInfoWithAttributes, } from './route-info';
export { default } from './router';
export { default as InternalTransition, logAbort, STATE_SYMBOL, PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, } from './transition';
export { default as TransitionState, TransitionError } from './transition-state';
export { default as InternalRouteInfo } from './route-info';
export { default as InternalRouteInfo, } from './route-info';
//# sourceMappingURL=index.js.map

@@ -8,3 +8,3 @@ import RouteRecognizer, { MatchCallback } from 'route-recognizer';

import TransitionState, { TransitionError } from './transition-state';
import { ChangeList, QueryParamsContainer } from './utils';
import { ChangeList, ModelsAndQueryParams } from './utils';
export interface SerializerFunc<T extends IModel> {

@@ -228,6 +228,6 @@ (model: T, params: string[]): Dict<unknown>;

*/
generate(routeName: string, ...args: ModelFor<R>[]): string;
generate(routeName: string, ...args: ModelsAndQueryParams<ModelFor<R>>): string;
applyIntent(routeName: string, contexts: ModelFor<R>[]): TransitionState<R>;
isActiveIntent(routeName: string, contexts: ModelFor<R>[], queryParams?: Dict<unknown> | null, _state?: TransitionState<R>): boolean;
isActive(routeName: string, ...args: ModelFor<R>[] | [...ModelFor<R>[], QueryParamsContainer]): boolean;
isActive(routeName: string, ...args: ModelsAndQueryParams<ModelFor<R>>): boolean;
trigger(name: string, ...args: any[]): void;

@@ -234,0 +234,0 @@ }

import { UnresolvedRouteInfoByObject, UnresolvedRouteInfoByParam, } from '../route-info';
import { TransitionIntent } from '../transition-intent';
import TransitionState from '../transition-state';
import { extractQueryParams, isParam, merge } from '../utils';
import { isParam, merge } from '../utils';
export default class NamedTransitionIntent extends TransitionIntent {

@@ -15,4 +15,3 @@ constructor(router, name, pivotHandler, contexts = [], queryParams = {}, data) {

applyToState(oldState, isIntermediate) {
// TODO: WTF fix me
let partitionedArgs = extractQueryParams([this.name].concat(this.contexts)), pureArgs = partitionedArgs[0], handlers = this.router.recognizer.handlersFor(pureArgs[0]);
let handlers = this.router.recognizer.handlersFor(this.name);
let targetRouteName = handlers[handlers.length - 1].handler;

@@ -19,0 +18,0 @@ return this.applyToHandlers(oldState, handlers, targetRouteName, isIntermediate, false);

@@ -11,2 +11,3 @@ import { QueryParams } from 'route-recognizer';

export declare function merge(hash: Dict<unknown>, other?: Dict<unknown>): void;
export declare type ModelsAndQueryParams<T> = T[] | [...T[], QueryParamsContainer];
/**

@@ -17,3 +18,3 @@ @private

**/
export declare function extractQueryParams<T>(array: T[] | [...T[], QueryParamsContainer]): [T[], QueryParams | null];
export declare function extractQueryParams<T>(array: ModelsAndQueryParams<T>): [T[], QueryParams | null];
export declare type QueryParamsContainer = {

@@ -20,0 +21,0 @@ queryParams: QueryParams;

{
"name": "router_js",
"version": "8.0.0",
"version": "8.0.1",
"description": "A lightweight JavaScript library is built on top of route-recognizer and rsvp.js to provide an API for handling routes",

@@ -43,2 +43,3 @@ "keywords": [

"@types/qunit": "^2.9.6",
"@types/rsvp": "^4.0.4",
"@typescript-eslint/eslint-plugin": "^5.10.2",

@@ -52,3 +53,3 @@ "@typescript-eslint/parser": "^5.10.2",

"broccoli-merge-trees": "^4.2.0",
"broccoli-typescript-compiler": "^7.0.0",
"broccoli-typescript-compiler": "^8.0.0",
"ember-cli": "~3.22.0",

@@ -71,3 +72,4 @@ "ember-cli-inject-live-reload": "^2.0.2",

"peerDependencies": {
"route-recognizer": "^0.3.4"
"route-recognizer": "^0.3.4",
"rsvp": "^4.8.5"
},

@@ -74,0 +76,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc