RunKit + npm: joi

node v18.11.0
endpointsharetweet
const Joi = require("joi"); const schema = Joi.object({ name: Joi.string(), email: Joi.string().email().required(), }).external((value) => { if (value.name === "John") value.name = "Jonathan"; return value; }); const data = { name: "John", email: 'jane@example.com' }; await schema.validateAsync(data);
Created from: https://npm.runkit.com/joi
Loading…