
Security News
Meet Socket at Black Hat Europe and BSides London 2025
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.
@lemoncode/fonk-chars-not-black-list-validator
Advanced tools
This is a [fonk](https://github.com/Lemoncode/fonk) microlibrary that brings validation capabilities to validate if a field of a form only contains valid characters
This is a fonk microlibrary that brings validation capabilities to:
How to install it:
npm install @lemoncode/fonk-chars-not-black-list-validator --save
How to add it to an existing form validation schema:
We have the following form model:
const myFormValues = {
product: 'shoes',
price: 20,
}
We can add a charsNotBlackList validation to the myFormValues. CustomArgs are required:
import { charsNotBlackList } from '@lemoncode/fonk-chars-not-black-list-validator';
const validationSchema = {
field: {
product: [
{
validator: charsNotBlackList.validator,
customArgs: { blackListChars: 'nw5' },
},
],
},
};
Some characters will need to be escaped on the blacklist because they are used in a RegExp. For example, if you want to include backslash (\) or simple quote(') as blacklist characters you will need to escape them:
import { charsNotBlackList } from '@lemoncode/fonk-chars-not-black-list-validator';
const validationSchema = {
field: {
product: [
{
validator: charsNotBlackList.validator,
customArgs: { blackListChars: 'n\'w\\5' },
},
],
},
};
You can customize the error message displayed in two ways:
import { charsNotBlackList } from '@lemoncode/fonk-chars-not-black-list-validator';
charsNotBlackList.setErrorMessage('El campo contiene caracteres no válidos.');
import { charsNotBlackList } from '@lemoncode/fonk-chars-not-black-list-validator';
const validationSchema = {
field: {
price: [
{
validator: charsNotBlackList.validator,
message: 'Error message only updated for the validation schema',
},
],
},
};
Please, refer to fonk to know more.
We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
Basefactor, consultancy by Lemoncode provides consultancy and coaching services.
Lemoncode provides training services.
For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend
FAQs
This is a [fonk](https://github.com/Lemoncode/fonk) microlibrary that brings validation capabilities to validate if a field of a form only contains valid characters
The npm package @lemoncode/fonk-chars-not-black-list-validator receives a total of 2 weekly downloads. As such, @lemoncode/fonk-chars-not-black-list-validator popularity was classified as not popular.
We found that @lemoncode/fonk-chars-not-black-list-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket is heading to London! Stop by our booth or schedule a meeting to see what we've been working on.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.