@cocreate/url-uploader 1.2.2 → 1.2.3

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/index.js +2 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/url-uploader",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "A simple url-uploader component in vanilla javascript. Easily configured using HTML5 data-attributes and/or JavaScript API.",
5
5
  "keywords": [
6
6
  "url-uploader",
@@ -37,6 +37,6 @@
37
37
  "type": "module",
38
38
  "main": "./src/index.js",
39
39
  "dependencies": {
40
- "node-fetch": "^3.3.2"
40
+ "@cocreate/server": "^1.6.1"
41
41
  }
42
42
  }
package/src/index.js CHANGED
@@ -21,7 +21,6 @@
21
21
  // For details, visit <https://cocreate.app/licenses/> or contact us at sales@cocreate.app.
22
22
 
23
23
  import { URL } from "url";
24
- import fetch from "node-fetch";
25
24
  import server from "@cocreate/server";
26
25
 
27
26
  /**
@@ -30,13 +29,7 @@ import server from "@cocreate/server";
30
29
  * @returns {string} Base64 formatted string
31
30
  */
32
31
  function arrayBufferToBase64(buffer) {
33
- let binary = "";
34
- const bytes = new Uint8Array(buffer);
35
- const len = bytes.byteLength;
36
- for (let i = 0; i < len; i++) {
37
- binary += String.fromCharCode(bytes[i]);
38
- }
39
- return Buffer.from(binary, "binary").toString("base64");
32
+ return Buffer.from(buffer).toString("base64");
40
33
  }
41
34
 
42
35
  /**
@@ -118,4 +111,4 @@ function init() {
118
111
  // Auto-execute initialization upon module compilation
119
112
  init();
120
113
 
121
- export default init;
114
+ export default init;