-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nested): Prevent infinite loops in getPath
- Loading branch information
jsek
committed
Aug 27, 2024
1 parent
0b018d9
commit e2656c9
Showing
3 changed files
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function preventLoops<T> (path: T[] | Set<T> | Map<T, any>, itemToPush: T) { | ||
if ( | ||
(Array.isArray(path) && path.includes(itemToPush)) || | ||
(path instanceof Set && path.has(itemToPush)) || | ||
(path instanceof Map && path.has(itemToPush)) | ||
) { | ||
throw new Error('[Vuetify] Could not resolve nested path because of duplicated identifiers') | ||
} | ||
} |