oef/node_modules/schema-utils
2019-11-04 15:00:46 +01:00
..
dist First commit 2019-11-04 15:00:46 +01:00
CHANGELOG.md First commit 2019-11-04 15:00:46 +01:00
LICENSE First commit 2019-11-04 15:00:46 +01:00
package.json First commit 2019-11-04 15:00:46 +01:00
README.md First commit 2019-11-04 15:00:46 +01:00

npm node deps test coverage chat

Schema Utils

Install

npm install --save schema-utils

Usage

validateOptions

import validateOptions from 'schema-utils'

validateOptions('path/to/schema.json', options, 'Loader/Plugin Name')

Examples

Loader

import { getOptions } from 'loader-utils'
import validateOptions from 'schema-utils'

function loader (src, map) {
  const options = getOptions(this) || {}

  validateOptions('path/to/schema.json', options, 'Loader Name')
}

Plugin

import Tapable from 'tapable'
import validateOptions from 'schema-utils'

class Plugin extends Tapable {
  constructor (options) {
    validateOptions('path/to/schema.json', options, 'Plugin Name')
  }
}

Maintainers


Juho Vepsäläinen

Joshua Wiens

Michael Ciniawsky