@uploadcare/upload-client 6.6.0 → 6.6.1

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.
@@ -281,15 +281,14 @@ const getFileOptions = ({ name }) => name ? [name] : [];
281
281
  const transformFile = identity;
282
282
  var getFormData = () => new FormData();
283
283
 
284
+ const isBuffer = (data) => false;
285
+
284
286
  const isBlob = (data) => {
285
287
  return typeof Blob !== 'undefined' && data instanceof Blob;
286
288
  };
287
289
  const isFile = (data) => {
288
290
  return typeof File !== 'undefined' && data instanceof File;
289
291
  };
290
- const isBuffer = (data) => {
291
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
292
- };
293
292
  const isReactNativeAsset = (data) => {
294
293
  return (!!data &&
295
294
  typeof data === 'object' &&
@@ -298,7 +297,7 @@ const isReactNativeAsset = (data) => {
298
297
  typeof data.uri === 'string');
299
298
  };
300
299
  const isFileData = (data) => {
301
- return (isBlob(data) || isFile(data) || isBuffer(data) || isReactNativeAsset(data));
300
+ return (isBlob(data) || isFile(data) || isBuffer() || isReactNativeAsset(data));
302
301
  };
303
302
 
304
303
  const isSimpleValue = (value) => {
@@ -398,7 +397,7 @@ const getUrl = (base, path, query) => {
398
397
  return url.toString();
399
398
  };
400
399
 
401
- var version = '6.6.0';
400
+ var version = '6.6.1';
402
401
 
403
402
  const LIBRARY_NAME = 'UploadcareUploadClient';
404
403
  const LIBRARY_VERSION = version;
@@ -453,7 +452,7 @@ const getFileName = (file) => {
453
452
  if (isFile(file) && file.name) {
454
453
  filename = file.name;
455
454
  }
456
- else if (isBlob(file) || isBuffer(file)) {
455
+ else if (isBlob(file) || isBuffer()) {
457
456
  filename = '';
458
457
  }
459
458
  else if (isReactNativeAsset(file) && file.name) {
@@ -1218,9 +1217,6 @@ const getBlobFromReactNativeAsset = async (asset) => {
1218
1217
  };
1219
1218
 
1220
1219
  const getFileSize = async (file) => {
1221
- if (isBuffer(file)) {
1222
- return file.length;
1223
- }
1224
1220
  if (isFile(file) || isBlob(file)) {
1225
1221
  return file.size;
1226
1222
  }
@@ -312,15 +312,14 @@ const getFileOptions = ({ name, contentType }) => [
312
312
  const transformFile = identity;
313
313
  var getFormData = () => new NodeFormData();
314
314
 
315
+ const isBuffer = (data) => data instanceof Buffer;
316
+
315
317
  const isBlob = (data) => {
316
318
  return typeof Blob !== 'undefined' && data instanceof Blob;
317
319
  };
318
320
  const isFile = (data) => {
319
321
  return typeof File !== 'undefined' && data instanceof File;
320
322
  };
321
- const isBuffer = (data) => {
322
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
323
- };
324
323
  const isReactNativeAsset = (data) => {
325
324
  return (!!data &&
326
325
  typeof data === 'object' &&
@@ -429,7 +428,7 @@ const getUrl = (base, path, query) => {
429
428
  return url.toString();
430
429
  };
431
430
 
432
- var version = '6.6.0';
431
+ var version = '6.6.1';
433
432
 
434
433
  const LIBRARY_NAME = 'UploadcareUploadClient';
435
434
  const LIBRARY_VERSION = version;
@@ -272,15 +272,14 @@ const request = ({ method, url, data, headers = {}, signal, onProgress }) => new
272
272
  }
273
273
  });
274
274
 
275
+ const isBuffer = (data) => false;
276
+
275
277
  const isBlob = (data) => {
276
278
  return typeof Blob !== 'undefined' && data instanceof Blob;
277
279
  };
278
280
  const isFile = (data) => {
279
281
  return typeof File !== 'undefined' && data instanceof File;
280
282
  };
281
- const isBuffer = (data) => {
282
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
283
- };
284
283
  const isReactNativeAsset = (data) => {
285
284
  return (!!data &&
286
285
  typeof data === 'object' &&
@@ -289,7 +288,7 @@ const isReactNativeAsset = (data) => {
289
288
  typeof data.uri === 'string');
290
289
  };
291
290
  const isFileData = (data) => {
292
- return (isBlob(data) || isFile(data) || isBuffer(data) || isReactNativeAsset(data));
291
+ return (isBlob(data) || isFile(data) || isBuffer() || isReactNativeAsset(data));
293
292
  };
294
293
 
295
294
  const getFileOptions = () => [];
@@ -406,7 +405,7 @@ const getUrl = (base, path, query) => {
406
405
  return url.toString();
407
406
  };
408
407
 
409
- var version = '6.6.0';
408
+ var version = '6.6.1';
410
409
 
411
410
  const LIBRARY_NAME = 'UploadcareUploadClient';
412
411
  const LIBRARY_VERSION = version;
@@ -461,7 +460,7 @@ const getFileName = (file) => {
461
460
  if (isFile(file) && file.name) {
462
461
  filename = file.name;
463
462
  }
464
- else if (isBlob(file) || isBuffer(file)) {
463
+ else if (isBlob(file) || isBuffer()) {
465
464
  filename = '';
466
465
  }
467
466
  else if (isReactNativeAsset(file) && file.name) {
@@ -1226,9 +1225,6 @@ const getBlobFromReactNativeAsset = async (asset) => {
1226
1225
  };
1227
1226
 
1228
1227
  const getFileSize = async (file) => {
1229
- if (isBuffer(file)) {
1230
- return file.length;
1231
- }
1232
1228
  if (isFile(file) || isBlob(file)) {
1233
1229
  return file.size;
1234
1230
  }
@@ -279,15 +279,14 @@ const getFileOptions = ({ name }) => name ? [name] : [];
279
279
  const transformFile = identity;
280
280
  var getFormData = () => new FormData();
281
281
 
282
+ const isBuffer = (data) => false;
283
+
282
284
  const isBlob = (data) => {
283
285
  return typeof Blob !== 'undefined' && data instanceof Blob;
284
286
  };
285
287
  const isFile = (data) => {
286
288
  return typeof File !== 'undefined' && data instanceof File;
287
289
  };
288
- const isBuffer = (data) => {
289
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
290
- };
291
290
  const isReactNativeAsset = (data) => {
292
291
  return (!!data &&
293
292
  typeof data === 'object' &&
@@ -296,7 +295,7 @@ const isReactNativeAsset = (data) => {
296
295
  typeof data.uri === 'string');
297
296
  };
298
297
  const isFileData = (data) => {
299
- return (isBlob(data) || isFile(data) || isBuffer(data) || isReactNativeAsset(data));
298
+ return (isBlob(data) || isFile(data) || isBuffer() || isReactNativeAsset(data));
300
299
  };
301
300
 
302
301
  const isSimpleValue = (value) => {
@@ -396,7 +395,7 @@ const getUrl = (base, path, query) => {
396
395
  return url.toString();
397
396
  };
398
397
 
399
- var version = '6.6.0';
398
+ var version = '6.6.1';
400
399
 
401
400
  const LIBRARY_NAME = 'UploadcareUploadClient';
402
401
  const LIBRARY_VERSION = version;
@@ -451,7 +450,7 @@ const getFileName = (file) => {
451
450
  if (isFile(file) && file.name) {
452
451
  filename = file.name;
453
452
  }
454
- else if (isBlob(file) || isBuffer(file)) {
453
+ else if (isBlob(file) || isBuffer()) {
455
454
  filename = '';
456
455
  }
457
456
  else if (isReactNativeAsset(file) && file.name) {
@@ -1216,9 +1215,6 @@ const getBlobFromReactNativeAsset = async (asset) => {
1216
1215
  };
1217
1216
 
1218
1217
  const getFileSize = async (file) => {
1219
- if (isBuffer(file)) {
1220
- return file.length;
1221
- }
1222
1218
  if (isFile(file) || isBlob(file)) {
1223
1219
  return file.size;
1224
1220
  }
@@ -310,15 +310,14 @@ const getFileOptions = ({ name, contentType }) => [
310
310
  const transformFile = identity;
311
311
  var getFormData = () => new NodeFormData();
312
312
 
313
+ const isBuffer = (data) => data instanceof Buffer;
314
+
313
315
  const isBlob = (data) => {
314
316
  return typeof Blob !== 'undefined' && data instanceof Blob;
315
317
  };
316
318
  const isFile = (data) => {
317
319
  return typeof File !== 'undefined' && data instanceof File;
318
320
  };
319
- const isBuffer = (data) => {
320
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
321
- };
322
321
  const isReactNativeAsset = (data) => {
323
322
  return (!!data &&
324
323
  typeof data === 'object' &&
@@ -427,7 +426,7 @@ const getUrl = (base, path, query) => {
427
426
  return url.toString();
428
427
  };
429
428
 
430
- var version = '6.6.0';
429
+ var version = '6.6.1';
431
430
 
432
431
  const LIBRARY_NAME = 'UploadcareUploadClient';
433
432
  const LIBRARY_VERSION = version;
@@ -270,15 +270,14 @@ const request = ({ method, url, data, headers = {}, signal, onProgress }) => new
270
270
  }
271
271
  });
272
272
 
273
+ const isBuffer = (data) => false;
274
+
273
275
  const isBlob = (data) => {
274
276
  return typeof Blob !== 'undefined' && data instanceof Blob;
275
277
  };
276
278
  const isFile = (data) => {
277
279
  return typeof File !== 'undefined' && data instanceof File;
278
280
  };
279
- const isBuffer = (data) => {
280
- return typeof Buffer !== 'undefined' && data instanceof Buffer;
281
- };
282
281
  const isReactNativeAsset = (data) => {
283
282
  return (!!data &&
284
283
  typeof data === 'object' &&
@@ -287,7 +286,7 @@ const isReactNativeAsset = (data) => {
287
286
  typeof data.uri === 'string');
288
287
  };
289
288
  const isFileData = (data) => {
290
- return (isBlob(data) || isFile(data) || isBuffer(data) || isReactNativeAsset(data));
289
+ return (isBlob(data) || isFile(data) || isBuffer() || isReactNativeAsset(data));
291
290
  };
292
291
 
293
292
  const getFileOptions = () => [];
@@ -404,7 +403,7 @@ const getUrl = (base, path, query) => {
404
403
  return url.toString();
405
404
  };
406
405
 
407
- var version = '6.6.0';
406
+ var version = '6.6.1';
408
407
 
409
408
  const LIBRARY_NAME = 'UploadcareUploadClient';
410
409
  const LIBRARY_VERSION = version;
@@ -459,7 +458,7 @@ const getFileName = (file) => {
459
458
  if (isFile(file) && file.name) {
460
459
  filename = file.name;
461
460
  }
462
- else if (isBlob(file) || isBuffer(file)) {
461
+ else if (isBlob(file) || isBuffer()) {
463
462
  filename = '';
464
463
  }
465
464
  else if (isReactNativeAsset(file) && file.name) {
@@ -1224,9 +1223,6 @@ const getBlobFromReactNativeAsset = async (asset) => {
1224
1223
  };
1225
1224
 
1226
1225
  const getFileSize = async (file) => {
1227
- if (isBuffer(file)) {
1228
- return file.length;
1229
- }
1230
1226
  if (isFile(file) || isBlob(file)) {
1231
1227
  return file.size;
1232
1228
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uploadcare/upload-client",
3
- "version": "6.6.0",
3
+ "version": "6.6.1",
4
4
  "description": "Library for work with Uploadcare Upload API",
5
5
  "type": "module",
6
6
  "module": "./dist/esm/index.node.mjs",
@@ -90,7 +90,7 @@
90
90
  "koa-body": "5.0.0",
91
91
  "mock-socket": "9.0.3",
92
92
  "start-server-and-test": "1.14.0",
93
- "@uploadcare/api-client-utils": "^6.6.0",
93
+ "@uploadcare/api-client-utils": "^6.6.1",
94
94
  "chalk": "^4.1.2"
95
95
  },
96
96
  "dependencies": {