flux-router-component
Advanced tools
Comparing version 0.3.1 to 0.3.2
var debug = require('debug')('navigateAction'), | ||
url = require('url'); | ||
queryString = require('query-string'), | ||
searchPattern = /\?([^\#]*)/; | ||
function parseQueryString(path) { | ||
var search; | ||
var matches = path.match(searchPattern); | ||
if (matches) { | ||
search = matches[1]; | ||
} | ||
return (search && queryString.parse(search)) || {}; | ||
} | ||
module.exports = function (context, payload, done) { | ||
@@ -21,4 +31,3 @@ if (!context.router || !context.router.getRoute) { | ||
// and make it part of CHANGE_ROUTE_XXX action payload. | ||
var parsed = route.path && url.parse(route.path, true); | ||
route.query = (parsed && parsed.query) || {}; | ||
route.query = parseQueryString(route.path); | ||
@@ -25,0 +34,0 @@ debug('dispatching CHANGE_ROUTE', route); |
{ | ||
"name": "flux-router-component", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Router-related React component and mixin for applications with Flux architecture", | ||
@@ -24,2 +24,3 @@ "main": "index.js", | ||
"debug": "^2.0.0", | ||
"query-string": "^1.0.0", | ||
"react": "^0.11.1" | ||
@@ -26,0 +27,0 @@ }, |
@@ -81,2 +81,9 @@ # flux-router-component [![Build Status](https://travis-ci.org/yahoo/flux-router-component.svg?branch=master)](https://travis-ci.org/yahoo/flux-router-component) [![Dependency Status](https://david-dm.org/yahoo/flux-router-component.svg)](https://david-dm.org/yahoo/flux-router-component) [![Coverage Status](https://coveralls.io/repos/yahoo/flux-router-component/badge.png?branch=master)](https://coveralls.io/r/yahoo/flux-router-component?branch=master) | ||
`Array.prototype.reduce` and `Array.prototype.map` (used by dependent library, query-string) polyfill examples are provided by: | ||
* [Mozilla Developer Network Array.prototype.reduce polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce#Polyfill) | ||
* [Mozilla Developer Network Array.prototype.map polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map#Polyfill) | ||
You can also look into this [polyfill.io polyfill service](https://cdn.polyfill.io/v1/). | ||
## License | ||
@@ -83,0 +90,0 @@ This software is free to use under the Yahoo! Inc. BSD license. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18371
290
96
3
+ Addedquery-string@^1.0.0
+ Addedquery-string@1.0.1(transitive)