From 6282b51ec95ca235eac998b3cc815aa1e2642ec8 Mon Sep 17 00:00:00 2001 From: Vahn Gomes Date: Wed, 13 Dec 2023 11:33:46 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8=20refactor(index.ts):=20simplify?= =?UTF-8?q?=20constructor=20signature=20by=20using=20type=20aliases=20for?= =?UTF-8?q?=20rules=20and=20messages=20parameters?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/index.ts b/src/index.ts index 2d2ac75..136412f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -150,15 +150,11 @@ class Validator { /** * Creates an instance of the Validator class. - * @param {{ [key: string]: Rule }} rules - The validation rules for each field. - * @param {{ [key: string]: Message }} messages - The error messages for each rule. + * @param {Rules} rules - The validation rules for each field. + * @param {Messages} messages - The error messages for each rule. * @param {Options} [options] - Additional options for validation. */ - constructor( - rules: { [key: string]: Rule }, - messages: { [key: string]: Message }, - options?: Options - ) { + constructor(rules: Rules, messages: Messages, options?: Options) { this.rules = rules; this.messages = messages; this.options = options || {};