Update validatem to @validatem/core
validateOptions now requires an arguments object.
This commit is contained in:
parent
adf17b2111
commit
3fefcb7cf6
9
index.js
9
index.js
|
@ -1,6 +1,13 @@
|
|||
"use strict";
|
||||
|
||||
const { validateArguments, required, oneOf, arrayOf, isString, isBoolean, allowExtraProperties, ValidationError } = require("validatem");
|
||||
const { validateArguments } = require("@validatem/core");
|
||||
const ValidationError = require("@validatem/error");
|
||||
const isBoolean = require("@validatem/is-boolean");
|
||||
const isString = require("@validatem/is-string");
|
||||
const required = require("@validatem/required");
|
||||
const arrayOf = require("@validatem/array-of");
|
||||
const oneOf = require("@validatem/one-of");
|
||||
const allowExtraProperties = require("@validatem/allow-extra-properties");
|
||||
|
||||
function isPostcssPlugin(value) {
|
||||
if (value.postcssPlugin == null || value.postcssVersion == null || typeof value !== "function") {
|
||||
|
|
11
package.json
11
package.json
|
@ -22,6 +22,14 @@
|
|||
"url": "https://git.cryto.net/joepie91/icssify/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@validatem/allow-extra-properties": "^0.1.0",
|
||||
"@validatem/array-of": "^0.1.2",
|
||||
"@validatem/core": "^0.3.15",
|
||||
"@validatem/error": "^1.1.0",
|
||||
"@validatem/is-boolean": "^0.1.1",
|
||||
"@validatem/is-string": "^1.0.0",
|
||||
"@validatem/one-of": "^0.1.1",
|
||||
"@validatem/required": "^0.1.1",
|
||||
"assure-array": "^1.0.0",
|
||||
"bl": "^4.0.0",
|
||||
"bluebird": "^3.7.1",
|
||||
|
@ -36,8 +44,7 @@
|
|||
"postcss-modules-local-by-default": "^3.0.2",
|
||||
"postcss-modules-scope": "^2.1.0",
|
||||
"postcss-modules-values": "^3.0.0",
|
||||
"through2": "^2.0.3",
|
||||
"validatem": "^0.2.0"
|
||||
"through2": "^2.0.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@joepie91/eslint-config": "^1.1.0",
|
||||
|
|
|
@ -14,12 +14,15 @@ Licensed under:
|
|||
const postcss = require("postcss");
|
||||
const icssUtils = require("icss-utils");
|
||||
const loaderUtils = require("loader-utils");
|
||||
const { validateOptions, required, isFunction, isBoolean } = require("validatem");
|
||||
const { validateOptions } = require("@validatem/core");
|
||||
const required = require("@validatem/required");
|
||||
const isBoolean = require("@validatem/is-boolean");
|
||||
const isFunction = require("@validatem/is-function");
|
||||
|
||||
const pluginName = 'postcss-icss-parser';
|
||||
|
||||
module.exports = postcss.plugin(pluginName, (options = {}) => {
|
||||
validateOptions([options], {
|
||||
module.exports = postcss.plugin(pluginName, function(options = {}) {
|
||||
validateOptions(arguments, {
|
||||
keyReplacer: [ required, isFunction ],
|
||||
autoExportImports: [ isBoolean ]
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue