mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
feat(Google Cloud Storage Node): Use streaming for file uploads (#6462)
fix(Google Cloud Storage Node): Use streaming for file uploads
This commit is contained in:
committed by
GitHub
parent
c7b74c3c1f
commit
cd0e41a6b4
@@ -53,6 +53,7 @@
|
||||
"crypto-js": "^4.1.1",
|
||||
"deep-equal": "^2.2.0",
|
||||
"esprima-next": "5.8.4",
|
||||
"form-data": "^4.0.0",
|
||||
"jmespath": "^0.16.0",
|
||||
"js-base64": "^3.7.2",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
// eslint-disable-next-line max-classes-per-file
|
||||
import type * as express from 'express';
|
||||
import type * as FormData from 'form-data';
|
||||
import type FormData from 'form-data';
|
||||
import type { IncomingHttpHeaders } from 'http';
|
||||
import type { Readable } from 'stream';
|
||||
import type { URLSearchParams } from 'url';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import FormData from 'form-data';
|
||||
import type { BinaryFileType, JsonObject } from './Interfaces';
|
||||
|
||||
const readStreamClasses = new Set(['ReadStream', 'Readable', 'ReadableStream']);
|
||||
@@ -5,6 +6,7 @@ const readStreamClasses = new Set(['ReadStream', 'Readable', 'ReadableStream']);
|
||||
export const isObjectEmpty = (obj: object | null | undefined): boolean => {
|
||||
if (obj === undefined || obj === null) return true;
|
||||
if (typeof obj === 'object') {
|
||||
if (obj instanceof FormData) return obj.getLengthSync() === 0;
|
||||
if (Array.isArray(obj)) return obj.length === 0;
|
||||
if (obj instanceof Set || obj instanceof Map) return obj.size === 0;
|
||||
if (ArrayBuffer.isView(obj) || obj instanceof ArrayBuffer) return obj.byteLength === 0;
|
||||
|
||||
Reference in New Issue
Block a user