New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-router-maa

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router-maa - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

example/package-lock.json

44

__test__/router/router.transition-middleware.test.js

@@ -249,7 +249,6 @@ import { __PRIVATES__, setCheckIfIsInitialisedFunction, pushTransitionAllowedCheckFunction, isTransitionAllowed } from '../../router/router.transition-middleware';

const transitionAllowedCheckFunction2 = () => true;
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(0);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
pushTransitionAllowedCheckFunction(transitionAllowedCheckFunction2);
const pop2 = pushTransitionAllowedCheckFunction(transitionAllowedCheckFunction2);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);

@@ -260,3 +259,30 @@ expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);

const transitionAllowedCheckFunction3 = () => true;
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(1);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
const pop3 = pushTransitionAllowedCheckFunction(transitionAllowedCheckFunction3);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[0].checkFunc).toEqual(transitionAllowedCheckFunction);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(2);
const transitionAllowedCheckFunction4 = () => true;
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(2);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
const pop4 = pushTransitionAllowedCheckFunction(transitionAllowedCheckFunction4);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[0].checkFunc).toEqual(transitionAllowedCheckFunction);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(3);
pop3();
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[0].checkFunc).toEqual(transitionAllowedCheckFunction);
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(2);
expect(__PRIVATES__.getIsCheckingIfTransitionIsAllowed()).toEqual(true);
resolveFunction(true);

@@ -268,5 +294,17 @@

expect(res).toEqual(true);
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1); // 1 poped since route allowed and replaced by one from routerTransitionAllowedChecksPushFunctionsStack
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(2); // 1 poped since route allowed and 2 added from routerTransitionAllowedChecksPushFunctionsStack
expect(__PRIVATES__.getRouterTransitionAllowedChecksPushFunctionsStack().length).toEqual(0);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[0].checkFunc).toEqual(transitionAllowedCheckFunction2);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[1].checkFunc).toEqual(transitionAllowedCheckFunction4);
pop3();
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(2); // nothing
pop2();
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(1);
expect(__PRIVATES__.getRouterTransitionAllowedChecks()[0].checkFunc).toEqual(transitionAllowedCheckFunction4);
pop4();
expect(__PRIVATES__.getRouterTransitionAllowedChecks().length).toEqual(0);
done();

@@ -273,0 +311,0 @@ })

2

package.json
{
"name": "react-router-maa",
"version": "2.0.2",
"version": "2.0.3",
"description": "state based react router linked to url through parseUrl and toUrl functions, has working route blocking control mechanisim, and async initialisation phase",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -13,2 +13,3 @@ import { promisifyFunctionCall, sortedInsert } from "./router.util";

let obj = { checkFunc, popOnceRouteAllowed, priority, popCheckFunc };
const pushFunc = sortedInsert.bind(null, routerTransitionAllowedChecks, obj, priorityComareFunc);
const popFunc = () => {

@@ -18,7 +19,12 @@ for(let i = 0; i < routerTransitionAllowedChecks.length; i++) {

routerTransitionAllowedChecks.splice(i, 1);
break;
return;
}
}
for(let i = 0; i < routerTransitionAllowedChecksPushFunctionsStack.length; i++) {
if(routerTransitionAllowedChecksPushFunctionsStack[i] === pushFunc) {
routerTransitionAllowedChecksPushFunctionsStack.splice(i, 1);
return;
}
}
};
const pushFunc = sortedInsert.bind(null, routerTransitionAllowedChecks, obj, priorityComareFunc);
if(isCheckingIfTransitionIsAllowed) {

@@ -25,0 +31,0 @@ routerTransitionAllowedChecksPushFunctionsStack.push(pushFunc);

Sorry, the diff of this file is too big to display

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