mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
use Buffer.isBuffer
This commit is contained in:
1 file changed
+1
-1
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user