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

redux-router-kit

Package Overview
Dependencies
Maintainers
1
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redux-router-kit - npm Package Compare versions

Comparing version 0.0.33 to 0.0.34

3

lib/components/Router.js

@@ -114,3 +114,3 @@ 'use strict';

var element = matchedRoutes.reduceRight(function (childElement, route) {
var element = matchedRoutes.reduceRight(function (childElement, route, matchedRouteIndex) {
var component = route.component;

@@ -124,2 +124,3 @@ var components = route.components;

route: route,
matchedRouteIndex: matchedRouteIndex,
// Deprecated

@@ -126,0 +127,0 @@ routeValue: route

@@ -95,3 +95,3 @@ 'use strict';

var testPathname = pathPattern[0] === '/' ? pathname : remainingPathname;
var params = matchPathnameToPattern(testPathname, pathPattern, routeValue);
var params = testPathname === '' && pathPattern === '.' ? {} : matchPathnameToPattern(testPathname, pathPattern, routeValue);

@@ -98,0 +98,0 @@ if (params) {

{
"name": "redux-router-kit",
"version": "0.0.33",
"version": "0.0.34",
"description": "Routing tools for Redux/React",

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

@@ -83,3 +83,3 @@ import React, { PropTypes } from 'react';

const element = matchedRoutes.reduceRight((childElement, route) => {
const element = matchedRoutes.reduceRight((childElement, route, matchedRouteIndex) => {
const { component, components } = route;

@@ -92,2 +92,3 @@ if (typeof component !== 'function' && (!component || typeof components !== 'object')) {

route,
matchedRouteIndex,
// Deprecated

@@ -94,0 +95,0 @@ routeValue: route

@@ -70,3 +70,7 @@ import pathToRegExp from 'path-to-regexp';

const testPathname = pathPattern[0] === '/' ? pathname : remainingPathname;
const params = matchPathnameToPattern(testPathname, pathPattern, routeValue);
const params = (testPathname === '' && pathPattern === '.') ? (
{}
) : (
matchPathnameToPattern(testPathname, pathPattern, routeValue)
);

@@ -73,0 +77,0 @@ if (params) {

@@ -110,1 +110,52 @@ import test from 'ava';

});
test('match index route', t => {
const routeMatch = matchRoutes({
'/todos': {
name: 'todos',
routes: {
'.': {
name: 'todos-index'
},
':id': {
name: 'todo'
}
}
}
}, '/todos');
t.same(routeMatch.key, ['/todos', '.']);
});
test('match index route at root', t => {
const routeMatch = matchRoutes({
'/': {
name: 'root',
routes: {
'.': {
name: 'home'
},
'todos': {
name: 'todos'
}
}
}
}, '/');
t.same(routeMatch.key, ['/', '.']);
});
test('match unknown route at root', t => {
const routeMatch = matchRoutes({
'/': {
name: 'root',
routes: {
'todos': {
name: 'todos'
},
'*': {
name: 'unknown'
}
}
}
}, '/todo');
t.same(routeMatch.key, ['/', '*']);
});
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