mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
fix: statfs when volume is not mounted
This commit is contained in:
@@ -6,6 +6,12 @@ type MountInfo = {
|
||||
fstype: string;
|
||||
};
|
||||
|
||||
export type StatFs = {
|
||||
total: number;
|
||||
used: number;
|
||||
free: number;
|
||||
};
|
||||
|
||||
function isPathWithin(base: string, target: string): boolean {
|
||||
const rel = path.posix.relative(base, target);
|
||||
return rel === "" || (!rel.startsWith("..") && !path.isAbsolute(rel));
|
||||
|
||||
Reference in New Issue
Block a user