diff options
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r-- | shared/extra-utils/requests/requests.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index 38e24d897..eb59ca600 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts | |||
@@ -182,6 +182,10 @@ function decodeQueryString (path: string) { | |||
182 | return decode(path.split('?')[1]) | 182 | return decode(path.split('?')[1]) |
183 | } | 183 | } |
184 | 184 | ||
185 | function unwrap <T> (test: request.Test): Promise<T> { | ||
186 | return test.then(res => res.body) | ||
187 | } | ||
188 | |||
185 | // --------------------------------------------------------------------------- | 189 | // --------------------------------------------------------------------------- |
186 | 190 | ||
187 | export { | 191 | export { |
@@ -194,5 +198,6 @@ export { | |||
194 | makePutBodyRequest, | 198 | makePutBodyRequest, |
195 | makeDeleteRequest, | 199 | makeDeleteRequest, |
196 | makeRawRequest, | 200 | makeRawRequest, |
201 | unwrap, | ||
197 | updateImageRequest | 202 | updateImageRequest |
198 | } | 203 | } |