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

anchor-validation

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anchor-validation - npm Package Compare versions

Comparing version 1.2.5 to 1.2.6

27

index.js

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

});
var required = exports.required = function required(value, error) {
var required = exports.required = function required(value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return value ? undefined : error;

@@ -27,3 +28,4 @@ };

var maxLength = exports.maxLength = function maxLength(max) {
return function (value, error) {
return function (value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return value && value.length > max ? error : undefined;

@@ -34,3 +36,4 @@ };

var minLength = exports.minLength = function minLength(min) {
return function (value, error) {
return function (value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return value && value.length < min ? error : undefined;

@@ -40,7 +43,10 @@ };

var isAlphanumeric = exports.isAlphanumeric = function isAlphanumeric(value, error) {
var isAlphanumeric = exports.isAlphanumeric = function isAlphanumeric(value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return value && /[^a-zA-Z0-9]/.test(value) ? error : undefined;
};
var isEmail = exports.isEmail = function isEmail(value, error) {
var isEmail = exports.isEmail = function isEmail(value) {
var error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
var emailRegex = /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i;

@@ -50,8 +56,15 @@ return value && !emailRegex.test(value) ? error : undefined;

var isEqual = exports.isEqual = function isEqual(value, comparison, error) {
var isEqual = exports.isEqual = function isEqual(value, comparison) {
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return value && comparison && value !== comparison ? error : undefined;
};
var isNotEqual = exports.isNotEqual = function isNotEqual(value, comparison, error) {
var isNotEqual = exports.isNotEqual = function isNotEqual(value, comparison) {
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return value && comparison && value === comparison ? error : undefined;
};
var oneOf = exports.oneOf = function oneOf(fn1, fn2) {
var error = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return fn1 || fn2 ? error : undefined;
};
{
"name": "anchor-validation",
"version": "1.2.5",
"version": "1.2.6",
"description": "anchor-validation for anchor-ui kit",

@@ -5,0 +5,0 @@ "main": "index.js",

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