diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-06 10:21:35 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:16 +0200 |
commit | c1bc8ee4783d6ce3102524e6c2a02b2f0f6aab6d (patch) | |
tree | 6f173749e46a79e6eca0bfd1f742054fa7276e7e /shared/extra-utils/requests/requests.ts | |
parent | e8bd7ce7ccafe3e064b03978e9b512c1a4cc99e6 (diff) | |
download | PeerTube-c1bc8ee4783d6ce3102524e6c2a02b2f0f6aab6d.tar.gz PeerTube-c1bc8ee4783d6ce3102524e6c2a02b2f0f6aab6d.tar.zst PeerTube-c1bc8ee4783d6ce3102524e6c2a02b2f0f6aab6d.zip |
Introduce feed command
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r-- | shared/extra-utils/requests/requests.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index eb59ca600..8c26a3699 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts | |||
@@ -182,10 +182,14 @@ 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> { | 185 | function unwrapBody <T> (test: request.Test): Promise<T> { |
186 | return test.then(res => res.body) | 186 | return test.then(res => res.body) |
187 | } | 187 | } |
188 | 188 | ||
189 | function unwrapText (test: request.Test): Promise<string> { | ||
190 | return test.then(res => res.text) | ||
191 | } | ||
192 | |||
189 | // --------------------------------------------------------------------------- | 193 | // --------------------------------------------------------------------------- |
190 | 194 | ||
191 | export { | 195 | export { |
@@ -198,6 +202,7 @@ export { | |||
198 | makePutBodyRequest, | 202 | makePutBodyRequest, |
199 | makeDeleteRequest, | 203 | makeDeleteRequest, |
200 | makeRawRequest, | 204 | makeRawRequest, |
201 | unwrap, | 205 | unwrapBody, |
206 | unwrapText, | ||
202 | updateImageRequest | 207 | updateImageRequest |
203 | } | 208 | } |