Browse Source

Initial commit

master
Sven Slootweg 2 years ago
commit
30741ba7db
  1. 1
      .gitignore
  2. 5
      README.md
  3. 11
      example.js
  4. 9
      index.js
  5. 9
      package.json

1
.gitignore

@ -0,0 +1 @@
node_modules

5
README.md

@ -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.

11
example.js

@ -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
*/

9
index.js

@ -0,0 +1,9 @@
"use strict";
module.exports = {
___validatem_isSpecial: true,
___validatem_isRequiredMarker: true,
___validatem_requiredMarkerVersion: 1,
};
module.exports.__modulePath = __dirname;

9
package.json

@ -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…
Cancel
Save