Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

schema-utils

Package Overview
Dependencies
Maintainers
2
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

schema-utils - npm Package Compare versions

Comparing version 0.2.1 to 0.3.0

dist/cjs.js

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="0.3.0"></a>
# [0.3.0](https://github.com/webpack-contrib/schema-utils/compare/v0.2.1...v0.3.0) (2017-04-29)
### Features
* add ValidationError ([#8](https://github.com/webpack-contrib/schema-utils/issues/8)) ([d48f0fb](https://github.com/webpack-contrib/schema-utils/commit/d48f0fb))
<a name="0.2.1"></a>

@@ -7,0 +17,0 @@ ## [0.2.1](https://github.com/webpack-contrib/schema-utils/compare/v0.2.0...v0.2.1) (2017-03-13)

8

dist/index.js

@@ -0,7 +1,8 @@

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.validateOptions = undefined;
var _validateOptions = require('./lib/validate-options');
var _validateOptions = require('./validateOptions');

@@ -12,3 +13,2 @@ var _validateOptions2 = _interopRequireDefault(_validateOptions);

exports.validateOptions = _validateOptions2.default;
//# sourceMappingURL=index.js.map
exports.default = _validateOptions2.default;
{
"name": "schema-utils",
"version": "0.2.1",
"version": "0.3.0",
"description": "Webpack Schema Validation Utilities",
"main": "dist/index.js",
"main": "dist/cjs.js",
"files": [
"dist",
"lib",
"src",
".babelrc"
"dist"
],
"engines": {
"node": ">= 4.3 < 5.0.0 || >= 5.10"
},
"scripts": {
"prebuild": "yarn run clean:dist",
"build": "cross-env NODE_ENV=production babel -s true src -d dist --ignore 'src/**/*.test.js'",
"clean:dist": "del-cli dist",
"start": "yarn run serve:dev src",
"serve:dev": "nodemon $2 --exec babel-node",
"start": "yarn run build -- -w",
"prebuild": "yarn run clean",
"build": "cross-env NODE_ENV=production babel src -d dist --ignore 'src/**/*.test.js'",
"clean": "del-cli dist",
"lint": "eslint --cache src test",
"lint-staged": "lint-staged",
"security": "nsp check",
"test": "jest",
"test:watch": "jest --watch",
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
"travis:test": "yarn run test",
"travis:coverage": "yarn run test:coverage",
"travis:lint": "yarn run lint && yarn run security",
"travis:test": "yarn run test",
"webpack-defaults": "webpack-defaults",
"lint-staged": "lint-staged",
"postinstall": "node lib/post_install.js",
"prepublish": "yarn run build",

@@ -32,34 +31,31 @@ "release": "yarn run standard-version"

"dependencies": {
"ajv": "^4.11.2"
"ajv": "^5.0.0"
},
"devDependencies": {
"babel-cli": "^6.22.2",
"babel-jest": "^18.0.0",
"babel-polyfill": "^6.22.0",
"babel-preset-env": "^1.2.1",
"babel-cli": "^6.24.1",
"babel-jest": "^19.0.0",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-polyfill": "^6.23.0",
"babel-preset-env": "^1.4.0",
"babel-preset-webpack": "^1.0.0",
"chai": "^3.5.0",
"codecov": "^1.0.1",
"cross-env": "^3.1.4",
"codecov": "^2.0.1",
"cross-env": "^4.0.0",
"del-cli": "^0.2.1",
"eslint": "^3.14.1",
"eslint-config-webpack": "^1.0.0",
"eslint": "^3.19.0",
"eslint-config-webpack": "^1.2.1",
"eslint-plugin-import": "^2.2.0",
"greenkeeper-postpublish": "^1.0.1",
"jest": "^18.1.0",
"lint-staged": "^3.3.1",
"nodemon": "^1.11.0",
"nsp": "^2.6.2",
"jest": "^19.0.2",
"lint-staged": "^3.4.0",
"nsp": "^2.6.3",
"pre-commit": "^1.2.2",
"shx": "^0.2.2",
"standard-version": "^4.0.0",
"webpack-defaults": "^0.2.1"
"webpack-defaults": "^0.4.5"
},
"engines": {
"node": ">=4.3 <5.0.0 || >=5.10"
"pre-commit": "lint-staged",
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
]
},
"repository": {
"type": "git",
"url": "git+https://github.com/webpack-contrib/schema-utils.git"
},
"eslintConfig": {

@@ -81,5 +77,11 @@ "extends": "webpack",

"name": "Joshua Wiens <@d3viant0ne>"
},
{
"name": "Michael Ciniawsky <@michael-ciniawsky>"
}
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/webpack-contrib/schema-utils.git"
},
"bugs": {

@@ -89,9 +91,3 @@ "url": "https://github.com/webpack-contrib/schema-utils/issues"

"homepage": "https://github.com/webpack-contrib/schema-utils#readme",
"pre-commit": "lint-staged",
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
]
}
"license": "MIT"
}
[![npm][npm]][npm-url]
[![node][node]][node-url]
[![deps][deps]][deps-url]
[![test][test]][test-url]
[![coverage][cover]][cover-url]
[![quality][quality]][quality-url]
[![chat][chat]][chat-url]
<div align="center">
<!-- replace with accurate logo e.g from https://worldvectorlogo.com/ -->
<a href="http://json-schema.org">
<!-- src="https://webpack-contrib.github.io/schema-utils/logo.png" -->
<img width="180" height="180"
src="https://raw.githubusercontent.com/json-schema-org/json-schema-org.github.io/master/img/logo.png">
</a>
<a href="https://github.com/webpack/webpack">
<img width="200" height="200" vspace="" hspace="25"
src="https://worldvectorlogo.com/logos/webpack.svg">
<img width="200" height="200" hspace="10"
src="https://webpack.js.org/assets/icon-square-big.svg">
</a>
<h1>Webpack Schema Utilities</h1>
<p>Schema validation utilities for Ajv<p>
<h1>Schema Utils</h1>
</div>

@@ -21,3 +24,3 @@

```bash
npm i schema-utils@latest
npm install --save schema-utils
```

@@ -27,23 +30,38 @@

### Validate Options
### `validateOptions`
```js
import validateOptions from 'schema-utils'
validateOptions('path/to/schema.json', options, 'Loader/Plugin Name')
```
<h2 align="center">Examples</h2>
```javascript
const { validateSchema } = require('schema-utils');
### Loader
...
```js
import { getOptions } from 'loader-utils'
import validateOptions from 'schema-utils'
// This injects possible default values to options
const validation = validateSchema(jsonSchema, options);
function loader (src, map) {
const options = getOptions(this) || {}
if(validation.isValid) {
throw new Error(validation.error);
validateOptions('path/to/schema.json', options, 'Loader Name')
}
```
// options are ok to use now
### Plugin
```js
import Tapable from 'tapable'
import validateOptions from 'schema-utils'
class Plugin extends Tapable {
constructor (options) {
validateOptions('path/to/schema.json', options, 'Plugin Name')
}
}
```
<h2 align="center">Maintainers</h2>

@@ -56,3 +74,3 @@

<img width="150" height="150"
src="https://avatars3.githubusercontent.com/u/166921?v=3&s=150">
src="https://github.com/bebraw.png?v=3&s=150">
</br>

@@ -63,6 +81,12 @@ <a href="https://github.com/bebraw">Juho Vepsäläinen</a>

<img width="150" height="150"
src="https://avatars2.githubusercontent.com/u/8420490?v=3&s=150">
src="https://github.com/d3viant0ne.png?v=3&s=150">
</br>
<a href="https://github.com/d3viant0ne">Joshua Wiens</a>
</td>
<td align="center">
<img width="150" height="150"
src="https://github.com/michael-ciniawsky.png?v=3&s=150">
</br>
<a href="https://github.com/michael-ciniawsky">Michael Ciniawsky</a>
</td>
</tr>

@@ -72,11 +96,12 @@ <tbody>

[npm]: https://img.shields.io/npm/v/schema-utils.svg
[npm-url]: https://npmjs.com/package/schema-utils
[node]: https://img.shields.io/node/v/schema-utils.svg
[node-url]: https://nodejs.org
[deps]: https://david-dm.org/webpack-contrib/schema-utils.svg
[deps-url]: https://david-dm.org/webpack-contrib/schema-utils
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
[chat-url]: https://gitter.im/webpack/webpack
[test]: http://img.shields.io/travis/webpack-contrib/schema-utils.svg

@@ -88,3 +113,3 @@ [test-url]: https://travis-ci.org/webpack-contrib/schema-utils

[quality]: https://www.bithound.io/github/webpack-contrib/schema-utils/badges/score.svg
[quality-url]: https://www.bithound.io/github/webpack-contrib/schema-utils
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg
[chat-url]: https://gitter.im/webpack/webpack
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc