Skip to content

Commit

Permalink
Updates build.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwickens committed Dec 1, 2020
1 parent 304a365 commit 44ec859
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 105 deletions.
8 changes: 6 additions & 2 deletions build/lib/PathUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ var PathUtils = {
var params = {};

paramNames.forEach(function (paramName, index) {
params[paramName] = match[index + 1];
var paramValue = match[index + 1];
if (paramValue != null) {
paramValue = decodeURIComponent(paramValue);
}
params[paramName] = paramValue;
});

return params;
Expand Down Expand Up @@ -112,7 +116,7 @@ var PathUtils = {
segment = params[paramName];
}

return segment;
return encodeURIComponent(segment);
}).replace(paramInjectTrailingSlashMatcher, '/');
},

Expand Down
15 changes: 15 additions & 0 deletions build/lib/TestUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,19 @@ exports.EchoBarParam = React.createClass({
this.context.router.getCurrentParams().bar
);
}
});

exports.EchoBarQuery = React.createClass({
displayName: 'EchoBarQuery',

contextTypes: {
router: PropTypes.router.isRequired
},
render: function render() {
return React.createElement(
'div',
{ className: 'EchoBarQuery' },
this.context.router.getCurrentQuery().bar
);
}
});
2 changes: 1 addition & 1 deletion build/lib/locations/HistoryLocation.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ var HistoryLocation = {
pop: History.back,

getCurrentPath: function getCurrentPath() {
return decodeURI(window.location.pathname + window.location.search);
return window.location.pathname + window.location.search;
},

toString: function toString() {
Expand Down
3 changes: 3 additions & 0 deletions build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"react",
"router"
],
"engines": {
"node": "10.x"
},
"keywords": [
"react",
"react-component",
Expand Down
Loading

0 comments on commit 44ec859

Please sign in to comment.