lepu-test-platform-web/node_modules/schema-utils
zhangbo db3ebd0df0 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
..
dist 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
CHANGELOG.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
LICENSE 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
README.md 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00
package.json 把之前百度云的代码移植过来 2024-01-03 15:23:47 +08:00

README.md

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