diff --git a/src/lib/client/SuperDebug.svelte b/src/lib/client/SuperDebug.svelte index ad4ff4ae..6ae34f9b 100644 --- a/src/lib/client/SuperDebug.svelte +++ b/src/lib/client/SuperDebug.svelte @@ -277,6 +277,7 @@ return '#}#undefined'; } if (typeof this === 'object' && this[key] instanceof Date) { + // @ts-expect-error Date checking works with isNaN return '#}D#' + (isNaN(this[key]) ? 'Invalid Date' : value); } if (typeof value === 'number') { diff --git a/src/lib/client/customValidity.ts b/src/lib/client/customValidity.ts index 9ffc2715..c7e0201b 100644 --- a/src/lib/client/customValidity.ts +++ b/src/lib/client/customValidity.ts @@ -18,10 +18,8 @@ export function setCustomValidityForm( formElement: HTMLFormElement, errors: ValidationErrors> ) { - for (const el of formElement.querySelectorAll< - HTMLInputElement & HTMLSelectElement & HTMLTextAreaElement & HTMLButtonElement - >('input,select,textarea,button')) { - if (noCustomValidityDataAttribute in el.dataset) { + for (const el of formElement.querySelectorAll('input,select,textarea,button')) { + if (('dataset' in el && noCustomValidityDataAttribute in el.dataset) || !el.name) { continue; }