mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 23:07:25 +08:00
## Description
Replaces raw JSON parsing with schema-based validation across frontend
TypeScript files to improve type safety and error handling.
### Scope of Changes
- Updated JSON parsing in:
- `account.ts`
- `import-export-settings.ts`
- `analytics-controller.ts`
- `local-storage-with-schema.ts`
- `url-handler.ts`
- `commandline/lists.ts`
- `test/wikipedia.ts`
- Added schema in `test/custom-text.ts`:
```typescript
export const customTextDataSchema = z.object({
text: z.array(z.string()),
mode: CustomTextModeSchema,
limit: z.object({
value: z.number(),
mode: CustomTextLimitModeSchema
}),
pipeDelimiter: z.boolean(),
});
```
### Benefits
- Enhanced runtime type safety
- More robust error handling
- Consistent JSON parsing approach
### Checks
- [x] Follows Conventional Commits
- [x] Includes GitHub username
- [ ] Adding quotes? (N/A)
- [ ] Adding language/theme? (N/A)
---------
Co-authored-by: Miodec <jack@monkeytype.com>
|
||
|---|---|---|
| .. | ||
| __tests__ | ||
| docker | ||
| scripts | ||
| src | ||
| static | ||
| .eslintrc.cjs | ||
| .firebaserc_example | ||
| firebase.json | ||
| gulpfile.js | ||
| knip.json | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.dev.js | ||
| vite.config.js | ||
| vite.config.prod.js | ||
| vitest.config.js | ||