-
-
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 25, 2024
1 parent
7e9a1b7
commit ab43fc4
Showing
4 changed files
with
15 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
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') | ||
} | ||
} |