diff --git a/README.md b/README.md index cc63567..6939cdf 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This npm package provides JavaScript functions to validate various forms fields. -Website: https://gabriel-logan.github.io/multiform-validator +Documentation: https://gabriel-logan.github.io/multiform-validator Feel free to find bugs and report them to me. Your feedback is highly appreciated. Hugs from Gabriel Logan! @@ -60,6 +60,8 @@ This package contains various modules for validating different types of data. Be - **validateSurname**: Surname validation. - **validateTextarea**: Textarea validation. +### For better information, read the documentation + ```javascript const validator = require('multiform-validator'); diff --git a/srcPage/css/home/style.css b/srcPage/css/home/style.css index 5f38918..5ac696e 100644 --- a/srcPage/css/home/style.css +++ b/srcPage/css/home/style.css @@ -26,6 +26,12 @@ section #npm_install { position: relative; justify-content: center; } +@media (min-width: 1000px) { + section #npm_install { + width: 890px; + margin: auto; + } +} section #npm_install button { width: 90px; position: absolute; diff --git a/srcPage/css/home/style.css.map b/srcPage/css/home/style.css.map index 828a51e..490a770 100644 --- a/srcPage/css/home/style.css.map +++ b/srcPage/css/home/style.css.map @@ -1 +1 @@ -{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,gBAAA;EACA,mBAAA;ACCJ;ADAI;EACI,eAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0CAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EACA,oCAAA;ACER;ADAI;EACI,aAAA;EACA,mBAAA;EACA,gBAAA;ACER;ADAI;EACI,kBAAA;EACA,uBAAA;ACER;ADDQ;EACI,WAAA;EACA,kBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,eAAA;EACA,YAAA;EACA,mCAAA;EACA,kQAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;EACA,qBAAA;EACA,gBAAA;EACA,oDAAA;ACGZ;ADDY;EACI,wQAAA;ACGhB;ADDY;EACI,yBAAA;ACGhB;ADCI;EACI,aAAA;EACA,sBAAA;EACA,mBAAA;ACCR;ADAQ;EACI,kBAAA;EACA,YAAA;ACEZ;ADCI;EACI,aAAA;EACA,cAAA;EACA,cAAA;EACA,iBAAA;EACA,cAAA;EACA,yBAAA;EACA,kBAAA;EACA,mBAAA;EACA,UAAA;EACA,YAAA;ACCR","file":"style.css"} \ No newline at end of file +{"version":3,"sources":["style.scss","style.css"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,aAAA;EACA,sBAAA;EACA,mBAAA;EACA,gBAAA;EACA,mBAAA;ACCJ;ADAI;EACI,eAAA;EACA,QAAA;EACA,SAAA;EACA,gCAAA;EACA,0CAAA;EACA,iBAAA;EACA,kBAAA;EACA,oBAAA;EACA,oCAAA;ACER;ADAI;EACI,aAAA;EACA,mBAAA;EACA,gBAAA;ACER;ADAI;EACI,kBAAA;EACA,uBAAA;ACER;ADDQ;EAHJ;IAIQ,YAAA;IACA,YAAA;ECIV;AACF;ADHQ;EACI,WAAA;EACA,kBAAA;EACA,YAAA;EACA,SAAA;EACA,UAAA;EACA,eAAA;EACA,YAAA;EACA,mCAAA;EACA,kQAAA;EACA,kBAAA;EACA,eAAA;EACA,gBAAA;EACA,gBAAA;EACA,qBAAA;EACA,gBAAA;EACA,oDAAA;ACKZ;ADHY;EACI,wQAAA;ACKhB;ADHY;EACI,yBAAA;ACKhB;ADDI;EACI,aAAA;EACA,sBAAA;EACA,mBAAA;ACGR;ADFQ;EACI,kBAAA;EACA,YAAA;ACIZ;ADDI;EACI,aAAA;EACA,cAAA;EACA,cAAA;EACA,iBAAA;EACA,cAAA;EACA,yBAAA;EACA,kBAAA;EACA,mBAAA;EACA,UAAA;EACA,YAAA;ACGR","file":"style.css"} \ No newline at end of file diff --git a/srcPage/css/home/style.scss b/srcPage/css/home/style.scss index f84796d..d1aac0a 100644 --- a/srcPage/css/home/style.scss +++ b/srcPage/css/home/style.scss @@ -24,6 +24,10 @@ section { #npm_install { position: relative; justify-content: center; + @media (min-width: 1000px) { + width: 890px; + margin: auto; + } button { width: 90px; position: absolute; @@ -71,4 +75,4 @@ section { width: 50%; margin: auto; } -} +} \ No newline at end of file diff --git a/srcPage/subPages/documentation/index.html b/srcPage/subPages/documentation/index.html index 4d8e8d0..c498a15 100644 --- a/srcPage/subPages/documentation/index.html +++ b/srcPage/subPages/documentation/index.html @@ -110,8 +110,9 @@
  • validateSurname
  • - - +
  • + validateTextarea +
  • @@ -447,4 +448,4 @@

    By - Gabriel Logan

    - + \ No newline at end of file diff --git a/srcPage/subPages/functions/cnpjIsValid.html b/srcPage/subPages/functions/cnpjIsValid.html index b2c49e7..8434051 100644 --- a/srcPage/subPages/functions/cnpjIsValid.html +++ b/srcPage/subPages/functions/cnpjIsValid.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/cpfIsValid.html b/srcPage/subPages/functions/cpfIsValid.html index 00ec07e..df74cf0 100644 --- a/srcPage/subPages/functions/cpfIsValid.html +++ b/srcPage/subPages/functions/cpfIsValid.html @@ -109,7 +109,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/getOnlyEmail.html b/srcPage/subPages/functions/getOnlyEmail.html index a018c8d..54c936d 100644 --- a/srcPage/subPages/functions/getOnlyEmail.html +++ b/srcPage/subPages/functions/getOnlyEmail.html @@ -109,7 +109,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/identifyFlagCard.html b/srcPage/subPages/functions/identifyFlagCard.html index 9f62e27..b3e8afd 100644 --- a/srcPage/subPages/functions/identifyFlagCard.html +++ b/srcPage/subPages/functions/identifyFlagCard.html @@ -109,7 +109,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isAscii.html b/srcPage/subPages/functions/isAscii.html index 6509649..9679252 100644 --- a/srcPage/subPages/functions/isAscii.html +++ b/srcPage/subPages/functions/isAscii.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isBase64.html b/srcPage/subPages/functions/isBase64.html index 097055d..5f3d614 100644 --- a/srcPage/subPages/functions/isBase64.html +++ b/srcPage/subPages/functions/isBase64.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isCEP.html b/srcPage/subPages/functions/isCEP.html index 11d7197..4ed5ef0 100644 --- a/srcPage/subPages/functions/isCEP.html +++ b/srcPage/subPages/functions/isCEP.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isCreditCardValid.html b/srcPage/subPages/functions/isCreditCardValid.html index 2f4f569..9417d01 100644 --- a/srcPage/subPages/functions/isCreditCardValid.html +++ b/srcPage/subPages/functions/isCreditCardValid.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isDate.html b/srcPage/subPages/functions/isDate.html index 7bba536..5c93636 100644 --- a/srcPage/subPages/functions/isDate.html +++ b/srcPage/subPages/functions/isDate.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isDecimal.html b/srcPage/subPages/functions/isDecimal.html index 5571640..ca8e301 100644 --- a/srcPage/subPages/functions/isDecimal.html +++ b/srcPage/subPages/functions/isDecimal.html @@ -111,8 +111,9 @@
  • validateSurname
  • - - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isEmail.html b/srcPage/subPages/functions/isEmail.html index 61df242..d82edc8 100644 --- a/srcPage/subPages/functions/isEmail.html +++ b/srcPage/subPages/functions/isEmail.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isEmpty.html b/srcPage/subPages/functions/isEmpty.html index f8eb44d..995c828 100644 --- a/srcPage/subPages/functions/isEmpty.html +++ b/srcPage/subPages/functions/isEmpty.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isMACAddress.html b/srcPage/subPages/functions/isMACAddress.html index 45713aa..070e4d0 100644 --- a/srcPage/subPages/functions/isMACAddress.html +++ b/srcPage/subPages/functions/isMACAddress.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isMD5.html b/srcPage/subPages/functions/isMD5.html index e8d5e41..2795f98 100644 --- a/srcPage/subPages/functions/isMD5.html +++ b/srcPage/subPages/functions/isMD5.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isNumber.html b/srcPage/subPages/functions/isNumber.html index 872c796..d47e68a 100644 --- a/srcPage/subPages/functions/isNumber.html +++ b/srcPage/subPages/functions/isNumber.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isPort.html b/srcPage/subPages/functions/isPort.html index 7c2ba92..fb6c343 100644 --- a/srcPage/subPages/functions/isPort.html +++ b/srcPage/subPages/functions/isPort.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isPostalCode.html b/srcPage/subPages/functions/isPostalCode.html index c217373..7b784b8 100644 --- a/srcPage/subPages/functions/isPostalCode.html +++ b/srcPage/subPages/functions/isPostalCode.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/isTime.html b/srcPage/subPages/functions/isTime.html index 7509693..f13e76f 100644 --- a/srcPage/subPages/functions/isTime.html +++ b/srcPage/subPages/functions/isTime.html @@ -112,7 +112,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/passwordStrengthTester.html b/srcPage/subPages/functions/passwordStrengthTester.html index d8525b8..16dde2c 100644 --- a/srcPage/subPages/functions/passwordStrengthTester.html +++ b/srcPage/subPages/functions/passwordStrengthTester.html @@ -112,7 +112,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateBRPhoneNumber.html b/srcPage/subPages/functions/validateBRPhoneNumber.html index 9603fc6..24b168a 100644 --- a/srcPage/subPages/functions/validateBRPhoneNumber.html +++ b/srcPage/subPages/functions/validateBRPhoneNumber.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateEmail.html b/srcPage/subPages/functions/validateEmail.html index fbe8147..d4217e1 100644 --- a/srcPage/subPages/functions/validateEmail.html +++ b/srcPage/subPages/functions/validateEmail.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateName.html b/srcPage/subPages/functions/validateName.html index a9870b8..a79edd5 100644 --- a/srcPage/subPages/functions/validateName.html +++ b/srcPage/subPages/functions/validateName.html @@ -111,7 +111,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validatePassportNumber.html b/srcPage/subPages/functions/validatePassportNumber.html index bc8055d..807e1d7 100644 --- a/srcPage/subPages/functions/validatePassportNumber.html +++ b/srcPage/subPages/functions/validatePassportNumber.html @@ -112,7 +112,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validatePassword.html b/srcPage/subPages/functions/validatePassword.html index a1700cc..404fb19 100644 --- a/srcPage/subPages/functions/validatePassword.html +++ b/srcPage/subPages/functions/validatePassword.html @@ -112,7 +112,9 @@ validateSurname - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validatePhoneNumber.html b/srcPage/subPages/functions/validatePhoneNumber.html index 5230883..9fc5c57 100644 --- a/srcPage/subPages/functions/validatePhoneNumber.html +++ b/srcPage/subPages/functions/validatePhoneNumber.html @@ -112,7 +112,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateSurname.html b/srcPage/subPages/functions/validateSurname.html index 6d51685..c2db59d 100644 --- a/srcPage/subPages/functions/validateSurname.html +++ b/srcPage/subPages/functions/validateSurname.html @@ -113,7 +113,9 @@ validateSurname - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateTextarea.html b/srcPage/subPages/functions/validateTextarea.html index 9d69dc9..dad64ef 100644 --- a/srcPage/subPages/functions/validateTextarea.html +++ b/srcPage/subPages/functions/validateTextarea.html @@ -112,8 +112,6 @@
  • validateSurname
  • - - @@ -127,19 +125,19 @@

    validateTextarea Function

    Function Signature

     									
    -									/**
    -									 * @param {string} textarea - The input textarea string to be validated.
    -									 * @param {boolean} [isRequired=false] - A boolean flag to determine if the textarea is required (default: false).
    -									 * @param {number} [maxLength=50] - The maximum allowed length for the textarea (default: 50).
    -									 * @param {string[]} [errorMsg=defaultErrorMsg] - An array of custom error messages for different validation conditions (default: predefined messages).
    -									 * @default isRequired boolean: default: false
    -									 * @default maxLength number: default: 50
    -									 * @example validateTextarea();
    -									 * @example validateTextarea();
    -									 * @example validateTextarea();
    -									 * @description This function returns an object with two properties: 'isValid' (boolean) and 'errorMsg' (string).
    -									 * The 'isValid' property indicates if the textarea is valid based on the given criteria, and 'errorMsg' contains the corresponding error message, if any.
    -									 */
    +/**
    +	* @param {string} textarea - The input textarea string to be validated.
    +	* @param {boolean} [isRequired=false] - A boolean flag to determine if the textarea is required (default: false).
    +	* @param {number} [maxLength=50] - The maximum allowed length for the textarea (default: 50).
    +	* @param {string[]} [errorMsg=defaultErrorMsg] - An array of custom error messages for different validation conditions (default: predefined messages).
    +	* @default isRequired boolean: default: false
    +	* @default maxLength number: default: 50
    +	* @example validateTextarea();
    +	* @example validateTextarea();
    +	* @example validateTextarea();
    +	* @description This function returns an object with two properties: 'isValid' (boolean) and 'errorMsg' (string).
    +	* The 'isValid' property indicates if the textarea is valid based on the given criteria, and 'errorMsg' contains the corresponding error message, if any.
    +	*/
     									
     									
    @@ -171,14 +169,14 @@

    Return Value

    Usage Examples

     									
    -									validateTextarea('Some text content'); // Example 1
    -									// Returns: { isValid: true, errorMsg: null }
    +validateTextarea('Some text content'); // Example 1
    +// Returns: { isValid: true, errorMsg: null }
     
    -									validateTextarea('', true); // Example 2
    -									// Returns: { isValid: false, errorMsg: 'Can not be empty' }
    +validateTextarea('', true); // Example 2
    +// Returns: { isValid: false, errorMsg: 'Can not be empty' }
     
    -									validateTextarea('Very long text...', false, 10); // Example 3
    -									// Returns: { isValid: false, errorMsg: 'This textarea is too big' }
    +validateTextarea('Very long text...', false, 10); // Example 3
    +// Returns: { isValid: false, errorMsg: 'This textarea is too big' }
     									
     									
    @@ -189,10 +187,10 @@

    Usage Examples

    Function Implementation

     									
    -									// The actual implementation of the validateTextarea function...
    -									function validateTextarea(textarea, isRequired = false, maxLength = 50, errorMsg = defaultErrorMsg) {
    -										// ... (The function implementation code) ...
    -									}
    +// The actual implementation of the validateTextarea function...
    +function validateTextarea(textarea, isRequired = false, maxLength = 50, errorMsg = defaultErrorMsg) {
    +	// ... (The function implementation code) ...
    +}
     									
     									
    @@ -217,4 +215,4 @@

    Function Implementation

    - + \ No newline at end of file diff --git a/srcPage/subPages/functions/validateUSPhoneNumber.html b/srcPage/subPages/functions/validateUSPhoneNumber.html index 4680cc1..86475ea 100644 --- a/srcPage/subPages/functions/validateUSPhoneNumber.html +++ b/srcPage/subPages/functions/validateUSPhoneNumber.html @@ -112,7 +112,9 @@
  • validateSurname
  • - +
  • + validateTextarea +
  • diff --git a/srcPage/subPages/functions/validateUsername.html b/srcPage/subPages/functions/validateUsername.html index ca69417..3750a20 100644 --- a/srcPage/subPages/functions/validateUsername.html +++ b/srcPage/subPages/functions/validateUsername.html @@ -112,8 +112,9 @@
  • validateSurname
  • - - +
  • + validateTextarea +