mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 08:28:19 +01:00
fix(federation): 🐛 Relax ISO string requirements
This commit is contained in:
parent
d19b103a17
commit
d4d8767274
|
|
@ -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());
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue