
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
rerevalidator
Advanced tools
Handy wrapper around revalidator (https://github.com/flatiron/revalidator) and simple server method
Handy wrapper around revalidator and simple validation schemas serve method (more not needed to put revalidator and validation schemas in ./public).
It also performs data types conversions (for example, if you specified some field as 'integer' in your schema and pass object with string '123' in it, after validation passed object will contain number '123' instead of string in that field). It works with arrays too.
You can install rerevalidator through npm:
npm install rerevalidator
You should feel free to improve that documentation (so for sources) and suggest me a pull request.
You can access wrapper through:
require('rerevalidator').validator;
This object has fields:
/**
* @param {number|undefined} minimum
* @param {number|undefined} maximum
* @param {boolean=} opt_required
* @param {Function=} opt_conform
*/
types.Integer(minimum, maximum, opt_required, opt_conform);
/**
* @param {number|undefined} minimum
* @param {number|undefined} maximum
* @param {boolean=} opt_required
* @param {Function=} opt_conform
*/
types.Number(minimum, maximum, opt_required, opt_conform);
/**
* @param {number|undefined} length
* @param {boolean=} required
* @param {Function=} conform
*/
types.String(length, opt_required, opt_conform);
/**
* @param {Array} values
* @param {boolean=} required
* @param {Function=} conform
*/
types.Enum(values, opt_required, opt_conform);
types.Timestamp(opt_required, opt_conform);
types.Text(opt_required, opt_conform);
types.Boolean(opt_required, opt_conform);
types.Email(opt_required, opt_conform);
types.PhoneNumber(opt_required, opt_conform);
types.ObjectId(opt_required, opt_conform);
types.DBRef(opt_required, opt_conform);
types.Lat(opt_required, opt_conform);
types.Lon(opt_required, opt_conform);
types.Point(opt_required, opt_conform);
types.GeoPointCoordinate(opt_required, opt_conform);
types.GeoPoint(opt_required, opt_conform);
If you needed to use same rerevalidator schemes on client you may simply serve rerevalidator and schemes to client by calling:
require('rerevalidator').serve(pathToSchemesScript, server);
After, it may be accessed via '/rerevalidator/minified.js' url.
You should manually implement check, where you schemes script is executed (in browser or by node), you may do this by calling typeof(window) – look in revalidator or rerevalidator sources for example.
In browser you can access rerevalidator as Validator object.
Server is any node.js http server.
After you should manually call server.listen to start it.
For more detailed documentation use sources.
FAQs
Handy wrapper around revalidator (https://github.com/flatiron/revalidator) and simple server method
The npm package rerevalidator receives a total of 4 weekly downloads. As such, rerevalidator popularity was classified as not popular.
We found that rerevalidator 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.