fix: ignore malformed data
Massimo Melina committed
Feb 13, 2024 at 21:46 UTC
335d28b6e10450c15389762c45ca49acd78bfb93
1 file changed
+2
-1
src/vfs.ts
+2
-1
@@ -305,8 +305,9 @@ export function masksCouldGivePermission(masks: Masks | undefined, perm: keyof V
305
}
306
307
export function parentMaskApplier(parent: VfsNode) {
308
- const matchers = onlyTruthy(Object.entries(parent.masks || {}).map(([k, { maskOnly, ...mods }]) => {
308
+ const matchers = onlyTruthy(_.map(parent.masks, (v, k) => {
309
k = k.startsWith('**/') ? k.slice(3) : !k.includes('/') ? k : '' // ** globstar matches also zero subfolders, so this mask must be applied here too
310
+ const { maskOnly, ...mods } = v || {}
311
// k is stored into the object for debugging purposes
312
return k && { k, mods, matcher: makeMatcher(k), mustBeFolder: maskOnly && (maskOnly === 'folders') }
313
}))