@felte/core
Advanced tools
Comparing version 1.4.1 to 1.4.2
import type { SuccessResponse } from './error'; | ||
/** | ||
* Creates a default submit handler for your form. | ||
* @param [form] - The form element to submit | ||
* @returns A promise that resolves to the response of the submission | ||
*/ | ||
export declare function createDefaultSubmitHandler(form?: HTMLFormElement): (() => Promise<SuccessResponse>) | undefined; | ||
//# sourceMappingURL=default-submit-handler.d.ts.map |
import type { SuccessResponse } from './error'; | ||
/** | ||
* Creates a default submit handler for your form. | ||
* @param [form] - The form element to submit | ||
* @returns A promise that resolves to the response of the submission | ||
*/ | ||
export declare function createDefaultSubmitHandler(form?: HTMLFormElement): (() => Promise<SuccessResponse>) | undefined; | ||
//# sourceMappingURL=default-submit-handler.d.ts.map |
import { FelteSubmitError } from './error.js'; | ||
/** | ||
* Creates a default submit handler for your form. | ||
* @param [form] - The form element to submit | ||
* @returns A promise that resolves to the response of the submission | ||
*/ | ||
function createDefaultSubmitHandler(form) { | ||
@@ -4,0 +9,0 @@ if (!form) |
@@ -142,3 +142,3 @@ import { executeTransforms, _cloneDeep, deepSome, deepSet, mergeErrors, debounce, _mergeWith, _isPlainObject, runValidations } from '@felte/common'; | ||
validationCount.update((c) => c + 1); | ||
const results = runValidations($data, validations); | ||
const results = runValidations(deepRemoveKey($data), validations); | ||
results.forEach(async (promise) => { | ||
@@ -209,7 +209,6 @@ const result = await promise; | ||
var _a; | ||
const $data = deepRemoveKey(data); | ||
const errors = validateErrors($data, storesShape, altValidate !== null && altValidate !== void 0 ? altValidate : config.validate, true); | ||
const errors = validateErrors(data, storesShape, altValidate !== null && altValidate !== void 0 ? altValidate : config.validate, true); | ||
if (altValidate) | ||
return errors; | ||
const debouncedErrors = validateDebouncedErrors($data, storesShape, (_a = config.debounced) === null || _a === void 0 ? void 0 : _a.validate, true); | ||
const debouncedErrors = validateDebouncedErrors(data, storesShape, (_a = config.debounced) === null || _a === void 0 ? void 0 : _a.validate, true); | ||
return mergeErrors(await Promise.all([errors, debouncedErrors])); | ||
@@ -219,7 +218,6 @@ } | ||
var _a; | ||
const $data = deepRemoveKey(data); | ||
const warnings = validateWarnings($data, storesShape, altWarn !== null && altWarn !== void 0 ? altWarn : config.warn, true); | ||
const warnings = validateWarnings(data, storesShape, altWarn !== null && altWarn !== void 0 ? altWarn : config.warn, true); | ||
if (altWarn) | ||
return warnings; | ||
const debouncedWarnings = validateDebouncedWarnings($data, storesShape, (_a = config.debounced) === null || _a === void 0 ? void 0 : _a.warn, true); | ||
const debouncedWarnings = validateDebouncedWarnings(data, storesShape, (_a = config.debounced) === null || _a === void 0 ? void 0 : _a.warn, true); | ||
return mergeErrors(await Promise.all([warnings, debouncedWarnings])); | ||
@@ -226,0 +224,0 @@ } |
{ | ||
"name": "@felte/core", | ||
"version": "1.4.1", | ||
"version": "1.4.2", | ||
"description": "Core utility for Felte's integration with front-end frameworks", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.cjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
400662
2961