@quatrain/storage-supabase 1.2.10-pr25.8069 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -291,7 +291,16 @@ class SupabaseStorageAdapter extends storage_1.AbstractStorageAdapter {
291
291
  const readable = new node_stream_1.Readable();
292
292
  readable.push(buffer);
293
293
  readable.push(null);
294
- return readable.pipe(res);
294
+ if (typeof (res === null || res === void 0 ? void 0 : res.on) === 'function') {
295
+ return readable.pipe(res);
296
+ }
297
+ else if (typeof (res === null || res === void 0 ? void 0 : res.send) === 'function') {
298
+ return res.send(buffer);
299
+ }
300
+ else if (typeof (res === null || res === void 0 ? void 0 : res.write) === 'function' && typeof (res === null || res === void 0 ? void 0 : res.end) === 'function') {
301
+ res.write(buffer);
302
+ return res.end();
303
+ }
295
304
  });
296
305
  }
297
306
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quatrain/storage-supabase",
3
- "version": "1.2.10-pr25.8069",
3
+ "version": "1.2.11",
4
4
  "description": "Storage adapter for Supabase Storage",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -32,7 +32,7 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@quatrain/core": "^1.2.18",
35
- "@quatrain/storage": "^1.2.13",
35
+ "@quatrain/storage": "^1.2.14",
36
36
  "@supabase/storage-js": "^2.7.2",
37
37
  "@supabase/supabase-js": "^2.108.2"
38
38
  },
@@ -306,7 +306,14 @@ export class SupabaseStorageAdapter extends AbstractStorageAdapter {
306
306
  readable.push(buffer)
307
307
  readable.push(null)
308
308
 
309
- return readable.pipe(res)
309
+ if (typeof res?.on === 'function') {
310
+ return readable.pipe(res)
311
+ } else if (typeof res?.send === 'function') {
312
+ return res.send(buffer)
313
+ } else if (typeof res?.write === 'function' && typeof res?.end === 'function') {
314
+ res.write(buffer)
315
+ return res.end()
316
+ }
310
317
  }
311
318
 
312
319
  /**