File tree 2 files changed +19
-19
lines changed
2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 1
1
import { FetchResponse } from './fetch_response'
2
2
import { RequestInterceptor } from './request_interceptor'
3
- import { getCookie } from './lib/cookie '
3
+ import { getCookie , compact , metaContent } from './lib/utils '
4
4
5
5
export class FetchRequest {
6
6
constructor ( method , url , options = { } ) {
@@ -102,21 +102,3 @@ export class FetchRequest {
102
102
return this . options . headers || { }
103
103
}
104
104
}
105
-
106
- function compact ( object ) {
107
- const result = { }
108
-
109
- for ( const key in object ) {
110
- const value = object [ key ]
111
- if ( value !== undefined ) {
112
- result [ key ] = value
113
- }
114
- }
115
-
116
- return result
117
- }
118
-
119
- function metaContent ( name ) {
120
- const element = document . head . querySelector ( `meta[name="${ name } "]` )
121
- return element && element . content
122
- }
Original file line number Diff line number Diff line change @@ -11,3 +11,21 @@ export function getCookie (name) {
11
11
}
12
12
}
13
13
}
14
+
15
+ export function compact ( object ) {
16
+ const result = { }
17
+
18
+ for ( const key in object ) {
19
+ const value = object [ key ]
20
+ if ( value !== undefined ) {
21
+ result [ key ] = value
22
+ }
23
+ }
24
+
25
+ return result
26
+ }
27
+
28
+ export function metaContent ( name ) {
29
+ const element = document . head . querySelector ( `meta[name="${ name } "]` )
30
+ return element && element . content
31
+ }
You can’t perform that action at this time.
0 commit comments