From 7b077cd6f68ab2f3ad79fc92c51a124fd64c7da9 Mon Sep 17 00:00:00 2001 From: Ale Soto Date: Tue, 29 Oct 2024 11:32:10 -0600 Subject: [PATCH 1/3] Adding rules export --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 99df7e5..3f87ecb 100644 --- a/src/index.ts +++ b/src/index.ts @@ -794,3 +794,5 @@ export class Validation implements FormValidation { return copy; } } + +export { validatorRules as rules } From b4787dbda0069280f5868c14f8a5065f8d5b7e0a Mon Sep 17 00:00:00 2001 From: Ale Soto Date: Thu, 23 Jan 2025 16:28:24 +0100 Subject: [PATCH 2/3] Adding fix for normalizer issue --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3f87ecb..5f88d30 100644 --- a/src/index.ts +++ b/src/index.ts @@ -119,7 +119,7 @@ export class Validation implements FormValidation { const normalizedValue = normalizer(field.value, field, this.form); // Only change the value if it's different from the normalized one. - if (normalizedValue && normalizedValue !== field.value) { + if (normalizedValue !== field.value) { field.value = normalizedValue; } } From 12a64d96220a74eb385d98f2fb63d7389cb4aee3 Mon Sep 17 00:00:00 2001 From: Ale Soto Date: Mon, 27 Jan 2025 18:42:36 +0100 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 93d2dbe..55b2c72 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ltvco/form-validation", - "version": "1.0.2", + "version": "1.0.3", "description": "Library to handle form validation, similar to jQuery Validation, but without any dependencies.", "types": "./dist/types/index.d.ts", "main": "./dist/index.js",