File tree 2 files changed +0
-35
lines changed 2 files changed +0
-35
lines changed Original file line number Diff line number Diff line change @@ -9,22 +9,6 @@ var PathUtils = require('./PathUtils');
9
9
*/
10
10
class Location {
11
11
12
- /**
13
- * Revives the location from its serialized form.
14
- * Use `Location.revive` as a second argument to `JSON.parse`.
15
- *
16
- * var serialized = JSON.stringify(location);
17
- * var deserialized = JSON.parse(serialized, Location.revive);
18
- *
19
- */
20
- static revive ( key , value ) {
21
- if ( key === '' ) {
22
- return new Location ( value . path , value . navigationType ) ;
23
- } else {
24
- return value ;
25
- }
26
- }
27
-
28
12
constructor ( path , navigationType ) {
29
13
this . path = path ;
30
14
this . navigationType = navigationType || NavigationTypes . POP ;
@@ -42,13 +26,6 @@ class Location {
42
26
return PathUtils . getQuery ( this . path , options ) ;
43
27
}
44
28
45
- toJSON ( ) {
46
- return {
47
- path : this . path ,
48
- navigationType : this . navigationType
49
- } ;
50
- }
51
-
52
29
}
53
30
54
31
module . exports = Location ;
Original file line number Diff line number Diff line change 1
1
var expect = require ( 'expect' ) ;
2
2
var Location = require ( '../Location' ) ;
3
- var NavigationTypes = require ( '../NavigationTypes' ) ;
4
3
5
4
describe ( 'Location' , function ( ) {
6
5
var location ;
7
6
8
- it ( 'can be revived' , function ( ) {
9
- location = new Location ( '/the/path' , NavigationTypes . POP ) ;
10
-
11
- var serialized = JSON . stringify ( location ) ;
12
- var revived = JSON . parse ( serialized , Location . revive ) ;
13
-
14
- expect ( revived instanceof Location ) . toEqual ( true ) ;
15
- expect ( revived . path ) . toEqual ( location . path ) ;
16
- expect ( revived . navigationType ) . toEqual ( location . navigationType ) ;
17
- } ) ;
18
-
19
7
describe ( 'with a query string' , function ( ) {
20
8
beforeEach ( function ( ) {
21
9
location = new Location ( '/the/path?the=query' ) ;
You can’t perform that action at this time.
0 commit comments