Skip to content

Commit 85adbe7

Browse files
committed
update src
1 parent e7bc858 commit 85adbe7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Diff for: visual-js/visual/src/api.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import fs from 'fs/promises';
1+
import fs from 'fs';
22
import fetch from 'node-fetch';
33
import crypto from 'crypto';
44
import { ProxyAgent } from 'proxy-agent';
@@ -158,9 +158,7 @@ const uploadToUrl = async ({
158158
file: DataContent | DataPath;
159159
compress?: boolean;
160160
}) => {
161-
const uploadBody = isDataPath(file)
162-
? await fs.readFile(file.path)
163-
: file.data;
161+
const uploadBody = isDataPath(file) ? fs.readFileSync(file.path) : file.data;
164162

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

0 commit comments

Comments
 (0)