@@ -950,14 +950,6 @@ var invariant = _dereq_('react/lib/invariant');
950
950
var merge = _dereq_ ( 'qs/lib/utils' ) . merge ;
951
951
var qs = _dereq_ ( 'qs' ) ;
952
952
953
- function decodePathSegment ( string ) {
954
- return decodeURIComponent ( string . replace ( / \+ / g, ' ' ) ) ;
955
- }
956
-
957
- function encodePathSegment ( string ) {
958
- return encodeURIComponent ( string ) . replace ( / % 2 0 / g, '+' ) ;
959
- }
960
-
961
953
var paramCompileMatcher = / : ( [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ] * ) | [ * . ( ) \[ \] \\ + | { } ^ $ ] / g;
962
954
var paramInjectMatcher = / : ( [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ? ] * [ ? ] ? ) | [ * ] / g;
963
955
var paramInjectTrailingSlashMatcher = / \/ \/ \? | \/ \? / g;
@@ -994,15 +986,15 @@ var Path = {
994
986
/**
995
987
* Safely decodes special characters in the given URL path.
996
988
*/
997
- decode : function decodePath ( path ) {
998
- return String ( path ) . split ( '/' ) . map ( decodePathSegment ) . join ( '/' ) ;
989
+ decode : function ( path ) {
990
+ return decodeURI ( path . replace ( / \+ / g , ' ' ) ) ;
999
991
} ,
1000
992
1001
993
/**
1002
994
* Safely encodes special characters in the given URL path.
1003
995
*/
1004
- encode : function encodePath ( path ) {
1005
- return String ( path ) . split ( '/' ) . map ( encodePathSegment ) . join ( '/ ') ;
996
+ encode : function ( path ) {
997
+ return encodeURI ( path ) . replace ( / % 2 0 / g , '+ ') ;
1006
998
} ,
1007
999
1008
1000
/**
@@ -1302,6 +1294,7 @@ var ImitateBrowserBehavior = _dereq_('../behaviors/ImitateBrowserBehavior');
1302
1294
var RouteHandler = _dereq_ ( '../components/RouteHandler' ) ;
1303
1295
var HashLocation = _dereq_ ( '../locations/HashLocation' ) ;
1304
1296
var HistoryLocation = _dereq_ ( '../locations/HistoryLocation' ) ;
1297
+ var RefreshLocation = _dereq_ ( '../locations/RefreshLocation' ) ;
1305
1298
var NavigationContext = _dereq_ ( '../mixins/NavigationContext' ) ;
1306
1299
var StateContext = _dereq_ ( '../mixins/StateContext' ) ;
1307
1300
var Scrolling = _dereq_ ( '../mixins/Scrolling' ) ;
@@ -1723,7 +1716,7 @@ function createRouter(options) {
1723
1716
1724
1717
module . exports = createRouter ;
1725
1718
1726
- } , { "../behaviors/ImitateBrowserBehavior" :2 , "../components/RouteHandler" :8 , "../locations/HashLocation" :10 , "../locations/HistoryLocation" :11 , "../mixins/NavigationContext" :15 , "../mixins/Scrolling" :16 , "../mixins/StateContext" :18 , "./Path" :19 , "./PropTypes" :21 , "./Redirect" :22 , "./Transition" :23 , "./createRoutesFromChildren" :25 , "./supportsHistory" :29 , "react/lib/ExecutionEnvironment" :35 , "react/lib/invariant" :39 , "react/lib/warning" :40 } ] , 25 :[ function ( _dereq_ , module , exports ) {
1719
+ } , { "../behaviors/ImitateBrowserBehavior" :2 , "../components/RouteHandler" :8 , "../locations/HashLocation" :10 , "../locations/HistoryLocation" :11 , "../locations/RefreshLocation" : 12 , "../ mixins/NavigationContext" :15 , "../mixins/Scrolling" :16 , "../mixins/StateContext" :18 , "./Path" :19 , "./PropTypes" :21 , "./Redirect" :22 , "./Transition" :23 , "./createRoutesFromChildren" :25 , "./supportsHistory" :29 , "react/lib/ExecutionEnvironment" :35 , "react/lib/invariant" :39 , "react/lib/warning" :40 } ] , 25 :[ function ( _dereq_ , module , exports ) {
1727
1720
var React = ( typeof window !== "undefined" ? window . React : typeof global !== "undefined" ? global . React : null ) ;
1728
1721
var warning = _dereq_ ( 'react/lib/warning' ) ;
1729
1722
var invariant = _dereq_ ( 'react/lib/invariant' ) ;
@@ -1783,7 +1776,7 @@ function createRoute(element, parentRoute, namedRoutes) {
1783
1776
1784
1777
if ( type === Redirect . type ) {
1785
1778
route . handler = createRedirectHandler ( props . to , props . params , props . query ) ;
1786
- props . path = props . path || props . from ;
1779
+ props . path = props . path || props . from || '*' ;
1787
1780
} else {
1788
1781
route . handler = props . handler ;
1789
1782
}
0 commit comments