Initial commit
commit
30741ba7db
@ -0,0 +1 @@
|
||||
node_modules
|
@ -0,0 +1,5 @@
|
||||
# @validatem/required
|
||||
|
||||
Documentation for this module has not been written yet. By the time it reaches 1.0.0, it will have full documentation.
|
||||
|
||||
In the meantime, check out the `example.js` file in the repository for a usage demonstration.
|
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
|
||||
const required = require("./");
|
||||
const { validateValue } = require("@validatem/core"); /* FIXME: Add to devDeps */
|
||||
|
||||
console.log(validateValue(42, [ required ])); // 42
|
||||
|
||||
console.log(validateValue(null, [ required ])); /*
|
||||
AggregrateValidationError: One or more validation errors occurred:
|
||||
- At (root): Required value is missing
|
||||
*/
|
@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
___validatem_isSpecial: true,
|
||||
___validatem_isRequiredMarker: true,
|
||||
___validatem_requiredMarkerVersion: 1,
|
||||
};
|
||||
|
||||
module.exports.__modulePath = __dirname;
|
@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "@validatem/required",
|
||||
"description": "Marks a field or value as 'required'",
|
||||
"version": "0.1.0",
|
||||
"main": "index.js",
|
||||
"repository": "http://git.cryto.net/validatem/required.git",
|
||||
"author": "Sven Slootweg <admin@cryto.net>",
|
||||
"license": "WTFPL OR CC0-1.0"
|
||||
}
|
Loading…
Reference in New Issue