@samitouri / QOSami-HFS / commits / 6c8c4281

better code: redundant code

Massimo Melina committed Feb 3, 2024 at 14:33 UTC 6c8c4281f7386607a2142d4b004a8b181b4d253a
1 file changed +2 -4
src/vfs.ts
+2 -4
@@ -95,11 +95,9 @@ export async function urlToNode(url: string, ctx?: Koa.Context, parent: VfsNode=
95 const ret = await getNodeByName(name, parent)
96 if (!ret)
97 return
98 - if (ret?.original)
99 - return urlToNode(rest, ctx, ret, getRest)
100 - if (parent.default)
98 + if (parent.default) // web folders have this default setting to ensure a standard behavior
99 inheritFromParent({ mime: { '*': MIME_AUTO } }, ret)
102 - if (rest)
100 + if (rest || ret?.original)
101 return urlToNode(rest, ctx, ret, getRest)
102 if (ret.source)
103 try {