@supabase/postgrest-js
Advanced tools
Comparing version
@@ -49,3 +49,7 @@ import { PostgrestBuilder, PostgrestSingleResponse } from './types'; | ||
single(): PromiseLike<PostgrestSingleResponse<T>>; | ||
/** | ||
* Set the response type to CSV. | ||
*/ | ||
csv(): this; | ||
} | ||
//# sourceMappingURL=PostgrestTransformBuilder.d.ts.map |
@@ -79,4 +79,11 @@ "use strict"; | ||
} | ||
/** | ||
* Set the response type to CSV. | ||
*/ | ||
csv() { | ||
this.headers['Accept'] = 'text/csv'; | ||
return this; | ||
} | ||
} | ||
exports.default = PostgrestTransformBuilder; | ||
//# sourceMappingURL=PostgrestTransformBuilder.js.map |
@@ -49,3 +49,3 @@ "use strict"; | ||
const text = yield res.text(); | ||
if (text && text !== '') | ||
if (text && text !== '' && this.headers['Accept'] !== 'text/csv') | ||
data = JSON.parse(text); | ||
@@ -52,0 +52,0 @@ } |
@@ -49,3 +49,7 @@ import { PostgrestBuilder, PostgrestSingleResponse } from './types'; | ||
single(): PromiseLike<PostgrestSingleResponse<T>>; | ||
/** | ||
* Set the response type to CSV. | ||
*/ | ||
csv(): this; | ||
} | ||
//# sourceMappingURL=PostgrestTransformBuilder.d.ts.map |
@@ -77,3 +77,10 @@ import { PostgrestBuilder } from './types'; | ||
} | ||
/** | ||
* Set the response type to CSV. | ||
*/ | ||
csv() { | ||
this.headers['Accept'] = 'text/csv'; | ||
return this; | ||
} | ||
} | ||
//# sourceMappingURL=PostgrestTransformBuilder.js.map |
@@ -43,3 +43,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const text = yield res.text(); | ||
if (text && text !== '') | ||
if (text && text !== '' && this.headers['Accept'] !== 'text/csv') | ||
data = JSON.parse(text); | ||
@@ -46,0 +46,0 @@ } |
{ | ||
"name": "@supabase/postgrest-js", | ||
"version": "0.28.4", | ||
"version": "0.29.0", | ||
"description": "Isomorphic PostgREST client", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -96,2 +96,10 @@ import { PostgrestBuilder, PostgrestSingleResponse } from './types' | ||
} | ||
/** | ||
* Set the response type to CSV. | ||
*/ | ||
csv(): this { | ||
this.headers['Accept'] = 'text/csv' | ||
return this | ||
} | ||
} |
@@ -94,3 +94,4 @@ import fetch from 'cross-fetch' | ||
const text = await res.text() | ||
if (text && text !== '') data = JSON.parse(text) | ||
if (text && text !== '' && this.headers['Accept'] !== 'text/csv') | ||
data = JSON.parse(text) | ||
} | ||
@@ -97,0 +98,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
184841
0.56%3432
0.88%