Skip to content

Commit

Permalink
fix: do not throw an error in case when passing an unknown property t…
Browse files Browse the repository at this point in the history
…o `updateProps`
  • Loading branch information
josdejong committed Oct 25, 2024
1 parent 65a3d4f commit 22e1fd0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/components/JSONEditor.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -374,16 +374,16 @@
default:
// We should never reach this default case
exhaustiveGuard(name)
unknownProperty(name)
}
}
if (!queryLanguages.some((queryLanguage) => queryLanguage.id === queryLanguageId)) {
queryLanguageId = queryLanguages[0].id
}
function exhaustiveGuard(name: never): never {
throw new Error(`Unknown property "${name}"`)
function unknownProperty(name: never) {
debug(`Unknown property "${name}"`)
}
await tick() // await rerender
Expand Down

0 comments on commit 22e1fd0

Please sign in to comment.