mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-20 11:41:38 +10:00
release: v4.1.0
This commit is contained in:
@ -33,19 +33,22 @@ export class JsonResumeParser implements Parser<Json, JsonResume> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
|
||||
// eslint-disable-next-line unicorn/prefer-add-event-listener
|
||||
reader.onload = () => {
|
||||
try {
|
||||
const result = JSON.parse(reader.result as string) as Json;
|
||||
resolve(result);
|
||||
} catch (error) {
|
||||
} catch {
|
||||
reject(new Error("Failed to parse JSON"));
|
||||
}
|
||||
};
|
||||
|
||||
// eslint-disable-next-line unicorn/prefer-add-event-listener
|
||||
reader.onerror = () => {
|
||||
reject(new Error("Failed to read the file"));
|
||||
};
|
||||
|
||||
// eslint-disable-next-line unicorn/prefer-blob-reading-methods
|
||||
reader.readAsText(file);
|
||||
});
|
||||
}
|
||||
|
||||
@ -4,10 +4,7 @@ const urlSchema = z.literal("").or(z.string().url()).optional();
|
||||
|
||||
const iso8601 = z
|
||||
.string()
|
||||
.regex(
|
||||
/^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$/,
|
||||
"ISO8601 Date Format",
|
||||
);
|
||||
.regex(/^([12]\d{3}-[01]\d-[0-3]\d|[12]\d{3}-[01]\d|[12]\d{3})$/, "ISO8601 Date Format");
|
||||
|
||||
const locationSchema = z.object({
|
||||
address: z.string().optional(),
|
||||
|
||||
Reference in New Issue
Block a user