0.1.6 • Published 4 years ago

config-validator-alpha v0.1.6

Weekly downloads
7
License
ISC
Repository
-
Last release
4 years ago

Config validator

Methods

validateAndCreateDefault(config, schema, location, options);
validate(config, schema, options)

Define

{
  "element": "string"
}

OR

{
  "element": {
    "type": "string",
    "required": false, // one of optional and required
    "optional": true, // one of optional and required
    "values": ["example1", "example2"],
    "default": "example1"
  }
}

Options

logger - function or null. Default: console.err(). strictMode - return error or log error. Default: true. requiredDefault - values are required if not opnional. coercion - true / false. Type coercion. Default: true. updateAfterCoercion - true / false. Type coercion. Default: false.

Types

  • number
  • boolean
  • string
  • symbol
  • object
  • bigint
  • url
  • array
  • integer
  • email
  • "*"

Test

npm run test
0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago