File tree 2 files changed +17
-17
lines changed
2 files changed +17
-17
lines changed Original file line number Diff line number Diff line change 1
1
import { FetchResponse } from './fetch_response'
2
- import { getCookie } from './lib/cookie '
2
+ import { getCookie , compact , metaContent } from './lib/utils '
3
3
4
4
export class FetchRequest {
5
5
constructor ( method , url , options = { } ) {
@@ -86,19 +86,3 @@ export class FetchRequest {
86
86
return this . options . headers || { }
87
87
}
88
88
}
89
-
90
- function compact ( object ) {
91
- const result = { }
92
- for ( const key in object ) {
93
- const value = object [ key ]
94
- if ( value !== undefined ) {
95
- result [ key ] = value
96
- }
97
- }
98
- return result
99
- }
100
-
101
- function metaContent ( name ) {
102
- const element = document . head . querySelector ( `meta[name="${ name } "]` )
103
- return element && element . content
104
- }
Original file line number Diff line number Diff line change @@ -8,3 +8,19 @@ export function getCookie (name) {
8
8
return value ? decodeURIComponent ( value ) : undefined
9
9
}
10
10
}
11
+
12
+ export function compact ( object ) {
13
+ const result = { }
14
+ for ( const key in object ) {
15
+ const value = object [ key ]
16
+ if ( value !== undefined ) {
17
+ result [ key ] = value
18
+ }
19
+ }
20
+ return result
21
+ }
22
+
23
+ export function metaContent ( name ) {
24
+ const element = document . head . querySelector ( `meta[name="${ name } "]` )
25
+ return element && element . content
26
+ }
You can’t perform that action at this time.
0 commit comments