Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Provides a few wrappers around Joi's validate(), attempt() and assert() functions with their arguments re-ordered for easier currying / partial application
#joi-fp
Provides a few wrappers around Joi's validate()
, attempt()
and assert()
functions with their arguments
re-ordered for easier currying / partial application
npm i joi-fp
When using functions like joi.validate()
, you will almost always have values for schema
and/or options
before you have the value
being validated. This little library re-orders the arguments of joi.validate()
, joi.attempt()
and joi.assert()
allowing you to pass the data you have initially, well, initially :) This library also has a few versions of these functions with fixed arities to make currying and partial application easier.
const _ = require('lodash')
const joi = require('joi-fp')(require('joi'))
// example with currying
const validateInput = _.curry(joi.validateFp3)({
name: joi.string().required()
})({allowUnknown: true});
validateInput({name: 'Max', color: 'blue'})
// { error: null, value: { name: 'Max', color: 'blue' } }
// example with partial application
const validateInputAgain = _.partial(joi.validateFp, {
name: joi.string().required()
}, {allowUnknown: true});
validateInputAgain({name: 'Max', color: 'blue'}, (err, value) => {
console.log(err, value) // null { name: 'Max', color: 'blue' }
})
// fixed arity for easy currying / partial application
validateFp2 (schema, value)
validateFp3 (schema, optionsOrValue, optionsOrCallback)
validateFp (schema, options, value, callback)
attemptFp2 (schema, value)
attemptFp (schema, message, value)
assertFp2 (schema, value)
assertFp (schema, message, value)
FAQs
Provides a few wrappers around Joi's validate(), attempt() and assert() functions with their arguments re-ordered for easier currying / partial application
The npm package joi-fp receives a total of 5 weekly downloads. As such, joi-fp popularity was classified as not popular.
We found that joi-fp 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
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.