fix(federation): 🐛 Relax ISO string requirements

This commit is contained in:
Jesse Wierzbinski 2024-11-23 14:20:06 +01:00
parent d19b103a17
commit d4d8767274
No known key found for this signature in database

View file

@ -60,7 +60,9 @@ export const extensionRegex: RegExp = createRegExp(
),
);
// This will accept a lot of stuff that isn't an ISO string
// but ISO validation is incredibly complex so fuck it
export const isISOString = (val: string | Date) => {
const d = new Date(val);
return !Number.isNaN(d.valueOf()) && d.toISOString() === val;
return !Number.isNaN(d.valueOf());
};