Fonk Doc
1. General
2. Validators
ValidatorsBuilt in validatorsThird Party validatorsfonk-is-number-validatorfonk-min-number-validatorfonk-max-number-validatorfonk-range-number-validatorfonk-positive-number-validatorfonk-negative-number-validatorfonk-is-lowercase-validatorfonk-is-uppercase-validatorfonk-match-field-validatorfonk-required-by-field-validatorfonk-is-credit-card-validatorfonk-is-url-validatorfonk-iban-validatorComing soon... fonk-bic-validatorComing soon... fonk-nif-validatorfonk-is-true-validatorfonk-array-required-validatorfonk-chars-not-black-list-validatorfonk-previous-date-validatorfonk-later-date-validatorfonk-range-date-validatorComing soon... fonk-is-ip-validatorComing soon... fonk-is-hex-color-validatorComing soon... fonk-is-json-validatorCustom validators synchronousCustom validators asynchronous
3. Messages
4. Form Libraries
5. API

Third party validators

If you need any specific validator that is not available in the core library, we have published a set of validators microlibraries. You can use them as in a buffet: cherry picking the ones you need, by following this approach you avoid adding any unnecessary weight to your application.

All this validators are avaible via the npm registry, each microlibrary GitHub repository contains the instructions about how to integrate them in your application.

fonk-is-number-validator

Validates whether a given field is a number.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-number-validator

github: https://github.com/Lemoncode/fonk-is-number-validator

fonk-min-number-validator

Validates whether a given field number is greater (or optionally equal) than a minimum value.

npm: https://www.npmjs.com/package/@lemoncode/fonk-min-number-validator

github: https://github.com/Lemoncode/fonk-min-number-validator

fonk-max-number-validator

Validates whether a given field number is lower (or optionally equal) than a maximum value.

npm: https://www.npmjs.com/package/@lemoncode/fonk-max-number-validator

github: https://github.com/Lemoncode/fonk-max-number-validator

fonk-range-number-validator

Validates whether a given field number is between a given numeric range (min - max).

npm: https://www.npmjs.com/package/@lemoncode/fonk-range-number-validator

github: https://github.com/Lemoncode/fonk-range-number-validator

fonk-positive-number-validator

Validates whether a given field number is positive.

npm: https://www.npmjs.com/package/@lemoncode/fonk-positive-number-validator

github:: https://github.com/Lemoncode/fonk-positive-number-validator

fonk-negative-number-validator

Validates whether a given field number is negative.

npm: https://www.npmjs.com/package/@lemoncode/fonk-negative-number-validator

github: https://github.com/Lemoncode/fonk-negative-number-validator

fonk-is-lowercase-validator

Validates that all characters in a given string are lowercase.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-lowercase-validator

github: https://github.com/Lemoncode/fonk-max-number-validator

fonk-is-uppercase-validator

Validates that all characters in a given string are uppercase.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-uppercase-validator

github: https://github.com/Lemoncode/fonk-is-uppercase-validator

fonk-match-field-validator

Validates that two fields have the same content.

This validator is useful for signup scenarios like:

  • Password and repeat your password fields.
  • Creating account: enter your email and reenter your email field, to ensure you haven't entered a typo.

npm: https://www.npmjs.com/package/@lemoncode/fonk-match-field-validator

github: https://github.com/Lemoncode/fonk-match-field-validator

fonk-required-by-field-validator

Makes a field required depending on another field value.

For instance:

  • Person form.
  • Persons can be US Citizen or not.
  • If a person is not a US Citized (checkbox US Citizen), then country field becomes required to be informed (mandatory).

npm: https://www.npmjs.com/package/@lemoncode/fonk-required-by-field-validator

github: https://github.com/Lemoncode/fonk-required-by-field-validator

fonk-is-credit-card-validator

Check if a string is a credit card.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-credit-card-validator

github: https://github.com/Lemoncode/fonk-is-credit-card-validator

fonk-is-url-validator

Validates whether a given field number is a well formed url.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-url-validator

github: https://github.com/Lemoncode/fonk-is-url-validator

fonk-iban-validator

Validates whether a given string field is a valid IBAN.

npm: https://www.npmjs.com/package/@lemoncode/fonk-iban-validator

github: https://github.com/Lemoncode/fonk-iban-validator

[Coming soon...] fonk-bic-validator

Validates whether a given string field is a well formed BIC code (Bank International Code).

npm: https://www.npmjs.com/package/@lemoncode/fonk-bic-validator

github: https://github.com/Lemoncode/fonk-bic-validator

[Coming soon...] fonk-nif-validator

Validates whether a given string field is a valid NIF. You could validate NIF, CIF, NIE, etc. using the customArgs.

npm: https://www.npmjs.com/package/@lemoncode/fonk-nif-validator

github: https://github.com/Lemoncode/fonk-nif-validator

fonk-is-true-validator

Validates whether a boolean field is true.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-true-validator

github: https://github.com/Lemoncode/fonk-is-true-validator

fonk-array-required-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-array-required-validator

github: https://github.com/Lemoncode/fonk-array-required-validator

fonk-chars-not-black-list-validator

Validate whether a field string only contains valid characters (characters that are not part of a given black list).

A possible scenario for this validator: an account id cannot contain spaces, back slash, single quotes, double quotes.

npm: https://www.npmjs.com/package/@lemoncode/fonk-chars-not-black-list-validator

github: https://github.com/Lemoncode/fonk-chars-not-black-list-validator

fonk-previous-date-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-previous-date-validator

github: https://github.com/Lemoncode/fonk-previous-date-validator

fonk-later-date-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-later-date-validator

github: https://github.com/Lemoncode/fonk-later-date-validator

fonk-range-date-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-range-date-validator

github: https://github.com/Lemoncode/fonk-range-date-validator

[Coming soon...] fonk-is-ip-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-ip-validator

github: https://github.com/Lemoncode/fonk-is-ip-validator

[Coming soon...] fonk-is-hex-color-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-hex-color-validator

github: https://github.com/Lemoncode/fonk-is-hex-color-validator

[Coming soon...] fonk-is-json-validator

Validates whether a given array field contains elements.

npm: https://www.npmjs.com/package/@lemoncode/fonk-is-json-validator

github: https://github.com/Lemoncode/fonk-is-json-validator