Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Nagoya is a validation library for writing cool and arbitrary validation schemas and producing user-friendly validation error messages.
import * as nagoya from 'nagoya';
const schema = {
username(username) {
nagoya.isString(username, 'not a string', TypeError);
nagoya.isAlphanumeric(username, 'must contain only letters and numbers');
// alternatively nagoya.matches(username, /^\w*$/)
nagoya.isMinLength(username, 3, 'must be at least 3 characters long');
nagoya.isMaxLength(username, 30, 'cannot be more than 30 characters long');
},
password(password) {
nagoya.isString(username, 'not a string', TypeError);
nagoya.isMinLength(username, 8, 'must be at least 8 characters long');
nagoya.isMaxLength(username, 30, 'cannot be more than 30 characters long');
},
email(emailAddress) {
nagoya.isEmail(emailAddress, 'must be a valid email address');
}
};
const validate = nagoya.schema(schema);
try {
validate({
username: '*asdf^',
password: 'foo321',
email: 'bob@@foo.com'
});
} catch (err) {
console.log(err.message);
console.log(err.columns);
}
// ValidationError: username must contain only letters and numbers,
// password must be at least 8 characters long,
// email must be a valid email address
// {
// username: [ValidationError: must contain only letters and numbers],
// password: [ValidationError: must be at least 8 characters long],
// email: [ValidationError: must be a valid email address]
// }
TODO
FAQs
Opinionated? validation library
The npm package nagoya receives a total of 16 weekly downloads. As such, nagoya popularity was classified as not popular.
We found that nagoya 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.