@hookstate/validation
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -1,6 +0,1 @@ | ||
var ValidationSeverity; | ||
(function (ValidationSeverity) { | ||
ValidationSeverity[ValidationSeverity["WARNING"] = 1] = "WARNING"; | ||
ValidationSeverity[ValidationSeverity["ERROR"] = 2] = "ERROR"; | ||
})(ValidationSeverity || (ValidationSeverity = {})); | ||
var PluginID = Symbol('Validate'); | ||
@@ -142,3 +137,3 @@ var emptyErrors = []; | ||
message: m, | ||
severity: s || ValidationSeverity.ERROR | ||
severity: s || 'error' | ||
}); | ||
@@ -176,3 +171,3 @@ }, | ||
export { Validation, ValidationSeverity }; | ||
export { Validation }; | ||
//# sourceMappingURL=index.es.js.map |
@@ -5,6 +5,2 @@ 'use strict'; | ||
(function (ValidationSeverity) { | ||
ValidationSeverity[ValidationSeverity["WARNING"] = 1] = "WARNING"; | ||
ValidationSeverity[ValidationSeverity["ERROR"] = 2] = "ERROR"; | ||
})(exports.ValidationSeverity || (exports.ValidationSeverity = {})); | ||
var PluginID = Symbol('Validate'); | ||
@@ -146,3 +142,3 @@ var emptyErrors = []; | ||
message: m, | ||
severity: s || exports.ValidationSeverity.ERROR | ||
severity: s || 'error' | ||
}); | ||
@@ -149,0 +145,0 @@ }, |
@@ -1,11 +0,3 @@ | ||
import { Plugin, Path, StateLink, StateValueAtPath } from '@hookstate/core'; | ||
export declare enum ValidationSeverity { | ||
WARNING = 1, | ||
ERROR = 2 | ||
} | ||
export interface ValidationRule { | ||
readonly message: string | ((value: StateValueAtPath) => string); | ||
readonly rule: (v: StateValueAtPath) => boolean; | ||
readonly severity: ValidationSeverity; | ||
} | ||
import { Plugin, Path, StateLink } from '@hookstate/core'; | ||
export declare type ValidationSeverity = 'error' | 'warning'; | ||
export interface ValidationError { | ||
@@ -12,0 +4,0 @@ readonly message: string; |
{ | ||
"name": "@hookstate/validation", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Plugin for @hookstate/core to enable validation of data state.", | ||
@@ -37,6 +37,6 @@ "license": "MIT", | ||
"peerDependencies": { | ||
"@hookstate/core": "1.0.0-alpha.2" | ||
"@hookstate/core": "^1.0.0-alpha.2" | ||
}, | ||
"devDependencies": { | ||
"@hookstate/core": "1.0.0-alpha.2", | ||
"@hookstate/core": "^1.0.0-alpha.2", | ||
"@testing-library/react": "8.0.5", | ||
@@ -43,0 +43,0 @@ "@testing-library/react-hooks": "1.1.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45702
361