File tree Expand file tree Collapse file tree 2 files changed +19
-19
lines changed
Expand file tree Collapse file tree 2 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 11import { FetchResponse } from './fetch_response'
22import { RequestInterceptor } from './request_interceptor'
3- import { getCookie } from './lib/cookie '
3+ import { getCookie , compact , metaContent } from './lib/utils '
44
55export class FetchRequest {
66 constructor ( method , url , options = { } ) {
@@ -102,21 +102,3 @@ export class FetchRequest {
102102 return this . options . headers || { }
103103 }
104104}
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) {
1111 }
1212 }
1313}
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