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

revalidate

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

revalidate - npm Package Compare versions

Comparing version 0.4.0 to 0.4.1

README.md

6

CHANGELOG.md

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

## v0.4.1
### Bug Fixes
- Fix not being able to compose other composed validators (Issue #23).
## v0.4.0

@@ -2,0 +8,0 @@

8

lib/composeValidators.js

@@ -22,2 +22,6 @@ 'use strict';

var _markAsValueValidator = require('./internal/markAsValueValidator');
var _markAsValueValidator2 = _interopRequireDefault(_markAsValueValidator);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -40,7 +44,7 @@

if (config.multiple === true) {
return (0, _createValidatorWithMultipleErrors2.default)(validators.slice(0), (0, _omit2.default)(config, 'multiple'));
return (0, _markAsValueValidator2.default)((0, _createValidatorWithMultipleErrors2.default)(validators.slice(0), (0, _omit2.default)(config, 'multiple')));
}
return (0, _createValidatorWithSingleError2.default)(validators.slice(0), config);
return (0, _markAsValueValidator2.default)((0, _createValidatorWithSingleError2.default)(validators.slice(0), config));
};
}

@@ -13,7 +13,7 @@ 'use strict';

function internalCombineValidators(validators) {
var atRoot = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
var atRoot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
return function valuesValidator() {
var values = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var allValues = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var allValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

@@ -20,0 +20,0 @@ return Object.keys(validators).reduce(function (errors, fieldName) {

@@ -21,3 +21,3 @@ 'use strict';

function isOneOf(values) {
var comparer = arguments.length <= 1 || arguments[1] === undefined ? defaultComparer : arguments[1];
var comparer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : defaultComparer;

@@ -24,0 +24,0 @@ var valuesClone = values.slice(0);

{
"name": "revalidate",
"version": "0.4.0",
"version": "0.4.1",
"description": "Elegant and composable validations",

@@ -13,8 +13,7 @@ "main": "lib/index.js",

"build": "babel src --out-dir lib",
"clean": "rm -rf lib",
"dev": "nodemon --exec 'clear; npm test' -w src -w test",
"lint": "eslint {src,test}",
"clean": "rimraf lib",
"lint": "eslint src/ test/",
"prepublish": "npm run clean && npm run build",
"test": "ava",
"test:watch": "ava -w"
"watch:test": "ava -w"
},

@@ -41,3 +40,3 @@ "repository": {

"babel-core": "^6.9.0",
"babel-eslint": "^6.0.4",
"babel-eslint": "^7.0.0",
"babel-plugin-check-es2015-constants": "^6.8.0",

@@ -58,6 +57,6 @@ "babel-plugin-transform-es2015-arrow-functions": "^6.8.0",

"eslint": "^3.2.2",
"eslint-config-airbnb-base": "^5.0.1",
"eslint-config-airbnb-base": "^8.0.0",
"eslint-import-resolver-node": "^0.2.0",
"eslint-plugin-import": "^1.12.0",
"nodemon": "^1.9.2"
"rimraf": "^2.5.4"
},

@@ -117,2 +116,3 @@ "dependencies": {

"rules": {
"arrow-parens": 0,
"consistent-return": 0,

@@ -125,2 +125,3 @@ "no-param-reassign": [

],
"no-plusplus": 0,
"no-unused-vars": [

@@ -127,0 +128,0 @@ "error",

@@ -5,2 +5,3 @@ import omit from 'lodash/omit';

import createValidatorWithSingleError from './internal/createValidatorWithSingleError';
import markAsValueValidator from './internal/markAsValueValidator';

@@ -18,13 +19,13 @@ export default function composeValidators(...validators) {

if (config.multiple === true) {
return createValidatorWithMultipleErrors(
return markAsValueValidator(createValidatorWithMultipleErrors(
validators.slice(0),
omit(config, 'multiple')
);
));
}
return createValidatorWithSingleError(
return markAsValueValidator(createValidatorWithSingleError(
validators.slice(0),
config
);
));
};
}
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