File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed
src/components/ErrorDecoder Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 50
50
"glamor" : " ^2.20.40" ,
51
51
"hex2rgba" : " ^0.0.1" ,
52
52
"prettier" : " ^1.7.4" ,
53
- "qs" : " ^6.5.1" ,
54
53
"remarkable" : " ^1.7.1" ,
55
54
"request-promise" : " ^4.2.2" ,
56
55
"rimraf" : " ^2.6.1" ,
Original file line number Diff line number Diff line change 8
8
'use strict' ;
9
9
10
10
import React from 'react' ;
11
- import qs from 'qs' ;
12
11
13
12
import type { Node } from 'react' ;
14
13
@@ -44,14 +43,25 @@ function urlify(str: string): Node {
44
43
function parseQueryString (
45
44
search : string ,
46
45
) : ?{ | code : string , args : Array < string > | } {
47
- const qsResult = qs . parse ( search , { ignoreQueryPrefix : true } ) ;
48
- if ( ! qsResult . invariant ) {
46
+ const rawQueryString = search . substring ( 1 ) ;
47
+ if ( ! rawQueryString ) {
49
48
return null ;
50
49
}
51
- return {
52
- code : qsResult . invariant ,
53
- args : qsResult . args || [ ] ,
54
- } ;
50
+
51
+ let code = '' ;
52
+ let args = [ ] ;
53
+
54
+ const queries = rawQueryString . split ( '&' ) ;
55
+ for ( let i = 0 ; i < queries . length ; i ++ ) {
56
+ const query = decodeURIComponent ( queries [ i ] ) ;
57
+ if ( query . indexOf ( 'invariant=' ) === 0 ) {
58
+ code = query . slice ( 10 ) ;
59
+ } else if ( query . indexOf ( 'args[' ) === 0 ) {
60
+ args . push ( query . slice ( query . indexOf ( ']=' ) + 2 ) ) ;
61
+ }
62
+ }
63
+
64
+ return { args, code} ;
55
65
}
56
66
57
67
function ErrorResult ( props : { | code : ?string , msg : string | } ) {
Original file line number Diff line number Diff line change @@ -7688,10 +7688,6 @@ qs@6.4.0, qs@~6.4.0:
7688
7688
version "6.4.0"
7689
7689
resolved "https://registry.yarnpkg.com/qs/-/qs-6.4.0.tgz#13e26d28ad6b0ffaa91312cd3bf708ed351e7233"
7690
7690
7691
- qs@^6.5.1 :
7692
- version "6.5.1"
7693
- resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.1.tgz#349cdf6eef89ec45c12d7d5eb3fc0c870343a6d8"
7694
-
7695
7691
query-string@^4.1.0 :
7696
7692
version "4.3.4"
7697
7693
resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb"
You can’t perform that action at this time.
0 commit comments