Skip to content

Commit

Permalink
use Buffer.isBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
undefined-moe committed Dec 14, 2024
1 parent 4879e9c commit 04335f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hydrooj/src/service/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class LocalStorageService {
target = resolve(this.dir, convertPath(target));
await ensureDir(dirname(target));
if (typeof file === 'string') await copyFile(file, target);
else if (file instanceof Buffer) await writeFile(target, file);
else if (Buffer.isBuffer(file)) await writeFile(target, file);
else await writeFile(target, await streamToBuffer(file));
}

Expand Down

0 comments on commit 04335f7

Please sign in to comment.