Skip to content

Commit

Permalink
update src
Browse files Browse the repository at this point in the history
  • Loading branch information
kb-kerem committed May 17, 2024
1 parent e7bc858 commit 85adbe7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions visual-js/visual/src/api.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'fs/promises';
import fs from 'fs';
import fetch from 'node-fetch';
import crypto from 'crypto';
import { ProxyAgent } from 'proxy-agent';
Expand Down Expand Up @@ -158,9 +158,7 @@ const uploadToUrl = async ({
file: DataContent | DataPath;
compress?: boolean;
}) => {
const uploadBody = isDataPath(file)
? await fs.readFile(file.path)
: file.data;
const uploadBody = isDataPath(file) ? fs.readFileSync(file.path) : file.data;

const hash = crypto.createHash('md5').update(uploadBody).digest('base64');

Expand Down

0 comments on commit 85adbe7

Please sign in to comment.