fix: parent permissions were overriding children with own permissions
Massimo Melina committed
Dec 31, 2022 at 00:04 UTC
b7657b4c845aa10785e43d45870951dd66880fe1
1 file changed
+3
-3
src/vfs.ts
+3
-3
@@ -54,12 +54,12 @@ function inheritFromParent(parent: VfsNode, child: VfsNode) {
54
for (const k of typedKeys(defaultPerms)) {
55
const v = parent[k]
56
if (v !== undefined)
57
- child[k] = v
57
+ child[k] ??= v
58
}
59
if (typeof parent.mime === 'object' && typeof child.mime === 'object')
60
- Object.assign(child.mime, parent.mime)
60
+ _.defaults(child.mime, parent.mime)
61
else
62
- child.mime = parent.mime
62
+ child.mime ||= parent.mime
63
return child
64
}
65