]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/requests/requests.ts
Introduce feed command
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / requests / requests.ts
index 38e24d89716967b8c9fc04da1177a11d603885ad..8c26a3699f99b84dc6e9b6bd862692e3c5ea2573 100644 (file)
@@ -182,6 +182,14 @@ function decodeQueryString (path: string) {
   return decode(path.split('?')[1])
 }
 
+function unwrapBody <T> (test: request.Test): Promise<T> {
+  return test.then(res => res.body)
+}
+
+function unwrapText (test: request.Test): Promise<string> {
+  return test.then(res => res.text)
+}
+
 // ---------------------------------------------------------------------------
 
 export {
@@ -194,5 +202,7 @@ export {
   makePutBodyRequest,
   makeDeleteRequest,
   makeRawRequest,
+  unwrapBody,
+  unwrapText,
   updateImageRequest
 }