Socket
Socket
Sign inDemoInstall

unobtrusive-validation

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.0 to 1.0.0

2

index.js

@@ -9,3 +9,3 @@ (function (global, factory) {

* https://github.com/kraaden/unobtrusive-validation
* Copyright (c) 2016 Denys Krasnoshchok
* Copyright (c) 2021 - Denys Krasnoshchok
* MIT License

@@ -12,0 +12,0 @@ */

/*
* https://github.com/kraaden/unobtrusive-validation
* Copyright (c) 2016 Denys Krasnoshchok
* Copyright (c) 2021 - Denys Krasnoshchok
* MIT License

@@ -16,3 +16,3 @@ */

*/
export const form_validation_handlers: ((evt: Event, succeeded: boolean) => void)[] = [];
export const validationHandlers: ((evt: Event, succeeded: boolean) => void)[] = [];

@@ -22,3 +22,3 @@ /**

*/
export const form_validators: ((element: IFormElement) => boolean)[] = [];
export const validators: ((element: IFormElement) => boolean)[] = [];

@@ -53,3 +53,3 @@ function getElementValue(element: IFormElement): string {

let success = true;
for (const validator of form_validators) {
for (const validator of validators) {
success = success && validator(element);

@@ -224,11 +224,11 @@ }

form_validators.push(requiredValidator);
form_validators.push(lengthValidator);
form_validators.push(regexValidator);
form_validators.push(rangeValidator);
form_validators.push(numberValidator);
form_validators.push(equalityValidator);
validators.push(requiredValidator);
validators.push(lengthValidator);
validators.push(regexValidator);
validators.push(rangeValidator);
validators.push(numberValidator);
validators.push(equalityValidator);
function executeHandlers(evt: Event, succeeded: boolean) {
for (let handler of form_validation_handlers) {
for (let handler of validationHandlers) {
handler(evt, succeeded);

@@ -235,0 +235,0 @@ }

{
"name": "unobtrusive-validation",
"version": "0.3.0",
"version": "1.0.0",
"description": "Lightweight unobtrusive ASP.NET validation without dependencies",

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

@@ -28,5 +28,5 @@ # Unobtrusive validation library without dependencies

import { form_validation_handlers } from 'unobtrusive-validation';
import { validationHandlers } from 'unobtrusive-validation';
form_validation_handlers.push(function(evt, succeeded) {
validationHandlers.push(function(evt, succeeded) {
if (!succeeded) {

@@ -39,3 +39,3 @@ hideSpinner();

const handlers = window["unobtrusive-validation"].form_validation_handlers;
const handlers = window["unobtrusive-validation"].validationHandlers;

@@ -42,0 +42,0 @@ handlers.push(function(evt, succeeded) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc