JAEGIS-METHOD-v2.0\v2.1.1\JAEGIS\JAEGIS_Core\JAEGIS-METHOD\node_modules\schema-utils\README
schema-utils
Package for validate options in loaders and plugins.
Getting Started
To begin, you'll need to install schema-utils:
npm install schema-utilsAPI
schema.json
{
"type": "object",
"properties": {
"option": {
"type": "boolean"
}
},
"additionalProperties": false
}schema
schemaType: String
JSON schema.
Simple example of schema:
options
optionsType: Object
Object with options.
configuration
configurationAllow to configure validator.
There is an alternative method to configure the name andbaseDataPath options via the title property in the schema. For example:
The last word used for the baseDataPath option, other words used for the name option. Based on the example above the name option equals My Loader, the baseDataPath option equals options.
name
Type: Object Default: "Object"
Allow to setup name in validation errors.
baseDataPath
Type: String Default: "configuration"
Allow to setup base data path in validation errors.
postFormatter
Type: Function Default: undefined
Allow to reformat errors.
Examples
schema.json
Loader
LoaderPlugin
PluginAllow to disable and enable validation (the validate function do nothing)
validate function do nothing)This can be useful when you don't want to do validation for production builds.
Also you can enable/disable validation using the process.env.SKIP_VALIDATION env variable.
Supported values (case insensitive):
yes/y/true/1/onno/n/false/0/off
Contributing
Please take a moment to read our contributing guidelines if you haven't yet done so.
License
Last updated
