fix: preserve fractional timestamp input compatibility
CSS quality / css-quality (push) Has been cancelled
CSS quality / css-quality (push) Has been cancelled
This commit is contained in:
@@ -26,6 +26,7 @@ describe('public HTTP input boundaries', () => {
|
||||
['2026-09-14T08:00:00+08:00', '2026-09-14T00:00:00.000Z'],
|
||||
['2026-09-14T00:00Z', '2026-09-14T00:00:00.000Z'],
|
||||
['2000-02-29T00:00:00.123Z', '2000-02-29T00:00:00.123Z'],
|
||||
['2026-09-14T00:00:00.123456789Z', '2026-09-14T00:00:00.123Z'],
|
||||
])('preserves valid calendar dates/timezones %s', (value, expected) => {
|
||||
expect(parseOpenApiDate(value).toISOString()).toBe(expected);
|
||||
});
|
||||
|
||||
@@ -12,7 +12,7 @@ export function pinnedWebhookLookup(address: string, family: number): LookupFunc
|
||||
|
||||
/** Validate calendar components before Date can normalize an impossible day. */
|
||||
export function parseOpenApiDate(value: string): Date {
|
||||
const parts = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(Z|[+-]\d{2}:\d{2}))?$/.exec(
|
||||
const parts = /^(\d{4})-(\d{2})-(\d{2})(?:T(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?(Z|[+-]\d{2}:\d{2}))?$/.exec(
|
||||
value,
|
||||
);
|
||||
if (parts) {
|
||||
|
||||
Reference in New Issue
Block a user