mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-07 10:15:14 -05:00
* Build filters WIP * Move builds to feature folder * Move stuff to builds feature folder * Working filters * AP values as dropdown * Should revalidate logic * Remove debounce * Fix main ability filter not working by default * Persist filters to search params * Disable button if too many filters * Stack on mobile * Abilities in i18n json * Ability icon in filter * Add i18n * E2E test * Remove done todo
8 lines
153 B
TypeScript
8 lines
153 B
TypeScript
export function safeJSONParse<T>(json: string, defaultValue: T): T {
|
|
try {
|
|
return JSON.parse(json);
|
|
} catch (e) {
|
|
return defaultValue;
|
|
}
|
|
}
|