svelte-reflector 2.5.2 → 2.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -299,7 +299,7 @@ function isInputEmpty(input: BuildedInput<unknown>): boolean {
|
|
|
299
299
|
* o `required` interno de um bloco opcional em branco e bloquearia o submit.
|
|
300
300
|
*/
|
|
301
301
|
function forEachBuildedInput(
|
|
302
|
-
schema:
|
|
302
|
+
schema: object,
|
|
303
303
|
fn: (input: BuildedInput<unknown>) => void,
|
|
304
304
|
skipOptionalEmpty: boolean,
|
|
305
305
|
): void {
|
|
@@ -321,7 +321,7 @@ function forEachBuildedInput(
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
function isEmptyDto(dto:
|
|
324
|
+
function isEmptyDto(dto: object): boolean {
|
|
325
325
|
let empty = true;
|
|
326
326
|
forEachBuildedInput(
|
|
327
327
|
dto,
|
|
@@ -342,7 +342,7 @@ function isEmptyDto(dto: Record<string, unknown>): boolean {
|
|
|
342
342
|
* Sem `throw`, sem `toast`, sem mutar o schema. Tocar todos é de propósito (não
|
|
343
343
|
* `.every`, que short-circuita e deixaria campos sem acender).
|
|
344
344
|
*/
|
|
345
|
-
export function validateForm(schema:
|
|
345
|
+
export function validateForm(schema: object): boolean {
|
|
346
346
|
let valid = true;
|
|
347
347
|
forEachBuildedInput(
|
|
348
348
|
schema,
|
|
@@ -363,7 +363,7 @@ export function validateForm(schema: Record<string, unknown>): boolean {
|
|
|
363
363
|
* `showError` já volta `false` de graça; o untouch só é necessário pra instância
|
|
364
364
|
* reutilizada.)
|
|
365
365
|
*/
|
|
366
|
-
export function untouchForm(schema:
|
|
366
|
+
export function untouchForm(schema: object): void {
|
|
367
367
|
forEachBuildedInput(schema, (input) => input.untouch(), false);
|
|
368
368
|
}
|
|
369
369
|
|