From bb4be0fba8a58b67e12ada7a61bbfb6300bf69f1 Mon Sep 17 00:00:00 2001 From: f0x Date: Sun, 20 Dec 2020 21:13:17 +0100 Subject: [PATCH] update validatem to @validatem/core --- index.js | 14 +++++++------- package.json | 10 ++++++++-- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 00743cc..c76defa 100644 --- a/index.js +++ b/index.js @@ -1,15 +1,15 @@ "use strict"; -const { validateArguments, required, oneOf, arrayOf, isString, allowExtraProperties, ValidationError } = require("validatem"); +const {validateArguments} = require("@validatem/core"); +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"); +const isPostcssPlugin = require("@validatem/is-postcss-plugin"); const createKahnSortingStream = require("./src/phase-streams/sort-kahn"); -function isPostcssPlugin(value) { - if (value.postcssPlugin == null || value.postcssVersion == null || typeof value !== "function") { - throw new ValidationError(`Must be a PostCSS plugin`); - } -} - // FIXME: When there's >1 icssify instance set up on the Browserify instance (can this happen when a module specifies its own dependency on icssify?), either throw an error (if incompatible?) or merge the two somehow, so that there's only one resulting .css file module.exports = function (browserify, options) { diff --git a/package.json b/package.json index 8de1e30..ca09260 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,13 @@ "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/is-postcss-plugin": "^0.1.0", + "@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", @@ -34,8 +41,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",