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

vivalid-rules-core

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vivalid-rules-core - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

bower.json

4

dist/vivalid-rules-core-bundle.js

@@ -8,7 +8,7 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

addValidatorBuilder('requiered',function(ValidationState,stateEnum,options){
addValidatorBuilder('required',function(ValidationState,stateEnum,options){
return function(value) {
var msg = options.msg || 'this field is requiered';
var msg = options.msg || 'this field is required';

@@ -15,0 +15,0 @@ if (!value){

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

!function n(e,r,i){function t(u,l){if(!r[u]){if(!e[u]){var v="function"==typeof require&&require;if(!l&&v)return v(u,!0);if(a)return a(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var o=r[u]={exports:{}};e[u][0].call(o.exports,function(n){var r=e[u][1][n];return t(r?r:n)},o,o.exports,n,e,r,i)}return r[u].exports}for(var a="function"==typeof require&&require,u=0;u<i.length;u++)t(i[u]);return t}({1:[function(n,e,r){var i=n("vivalid"),t=i.validatorRepo.addBuilder;t("requiered",function(n,e,r){return function(i){var t=r.msg||"this field is requiered";return i?new n("",e.valid):new n(t,e.invalid)}}),t("maxlength",function(n,e,r){return function(i){var t=r.msg||"maximum "+r.max+" characters allowed";return i.length>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("minlength",function(n,e,r){return function(i){var t=r.msg||"minimum "+r.min+" characters allowed";return i.length<r.min?new n(t,e.invalid):new n("",e.valid)}}),t("betweenlength",function(n,e,r){return function(i){var t=r.msg||"between "+r.min+"-"+r.max+" characters allowed";return i.length<r.min||i.length>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("max",function(n,e,r){return function(i){var t=r.msg||"maximum value is "+r.max;return i>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("min",function(n,e,r){return function(i){var t=r.msg||"minimum value is "+r.min;return i<r.min?new n(t,e.invalid):new n("",e.valid)}}),t("pattern",function(n,e,r){return function(i){var t=r.msg||"input characters must match: "+r.regex,a=new RegExp(r.regex);return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}}),t("email",function(n,e,r){return function(i){var t=r.msg||"invalid email address",a=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}}),t("url",function(n,e,r){return function(i){var t=r.msg||"invalid URL",a=/^(ftp|http|https):\/\/[^ "]+$/;return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}})},{vivalid:"vivalid"}]},{},[1]);
!function n(e,r,i){function t(u,l){if(!r[u]){if(!e[u]){var v="function"==typeof require&&require;if(!l&&v)return v(u,!0);if(a)return a(u,!0);var m=new Error("Cannot find module '"+u+"'");throw m.code="MODULE_NOT_FOUND",m}var o=r[u]={exports:{}};e[u][0].call(o.exports,function(n){var r=e[u][1][n];return t(r?r:n)},o,o.exports,n,e,r,i)}return r[u].exports}for(var a="function"==typeof require&&require,u=0;u<i.length;u++)t(i[u]);return t}({1:[function(n,e,r){var i=n("vivalid"),t=i.validatorRepo.addBuilder;t("required",function(n,e,r){return function(i){var t=r.msg||"this field is required";return i?new n("",e.valid):new n(t,e.invalid)}}),t("maxlength",function(n,e,r){return function(i){var t=r.msg||"maximum "+r.max+" characters allowed";return i.length>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("minlength",function(n,e,r){return function(i){var t=r.msg||"minimum "+r.min+" characters allowed";return i.length<r.min?new n(t,e.invalid):new n("",e.valid)}}),t("betweenlength",function(n,e,r){return function(i){var t=r.msg||"between "+r.min+"-"+r.max+" characters allowed";return i.length<r.min||i.length>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("max",function(n,e,r){return function(i){var t=r.msg||"maximum value is "+r.max;return i>r.max?new n(t,e.invalid):new n("",e.valid)}}),t("min",function(n,e,r){return function(i){var t=r.msg||"minimum value is "+r.min;return i<r.min?new n(t,e.invalid):new n("",e.valid)}}),t("pattern",function(n,e,r){return function(i){var t=r.msg||"input characters must match: "+r.regex,a=new RegExp(r.regex);return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}}),t("email",function(n,e,r){return function(i){var t=r.msg||"invalid email address",a=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}}),t("url",function(n,e,r){return function(i){var t=r.msg||"invalid URL",a=/^(ftp|http|https):\/\/[^ "]+$/;return a.exec(i)?new n("",e.valid):new n(t,e.invalid)}})},{vivalid:"vivalid"}]},{},[1]);

@@ -7,7 +7,7 @@ // waiting on https://github.com/substack/node-browserify/issues/968 to use:

addValidatorBuilder('requiered',function(ValidationState,stateEnum,options){
addValidatorBuilder('required',function(ValidationState,stateEnum,options){
return function(value) {
var msg = options.msg || 'this field is requiered';
var msg = options.msg || 'this field is required';

@@ -14,0 +14,0 @@ if (!value){

{
"name": "vivalid-rules-core",
"version": "0.1.0",
"version": "0.1.1",
"description": "core rules for the vivalid client side validations library",
"main": "./lib/vivalid-rules-core.js",
"dependencies": {
"vivalid": "^0.1.0"
"vivalid": "^0.1.1"
},

@@ -9,0 +9,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

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