@hookstate/validation
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -7,6 +7,2 @@ var PluginID = Symbol('Validate'); | ||
} | ||
// same as Array.from(Object.values()) but does not require ES6. | ||
// arrayFromObjectValues(obj: object) { | ||
// return Object.keys(obj).map(key => obj[key]) | ||
// } | ||
ValidationPluginInstance.prototype.getRulesAndNested = function (path) { | ||
@@ -20,3 +16,3 @@ var result = this.storeRules; | ||
}); | ||
return [result && result[PluginID] ? Array.from(Object.values(result[PluginID])) : [], | ||
return [result && result[PluginID] ? Array.from(result[PluginID].values()) : [], | ||
result ? Object.keys(result) : []]; | ||
@@ -82,5 +78,2 @@ }; | ||
if (Array.isArray(nestedInst)) { | ||
// only validation for all array elements is supported | ||
// because of this limitation, it is expected that the first element is '*' | ||
// if any rules are defined | ||
if (nestedRulesKeys.includes('*')) { | ||
@@ -87,0 +80,0 @@ for (var i = 0; i < nestedInst.length; i += 1) { |
@@ -11,6 +11,2 @@ 'use strict'; | ||
} | ||
// same as Array.from(Object.values()) but does not require ES6. | ||
// arrayFromObjectValues(obj: object) { | ||
// return Object.keys(obj).map(key => obj[key]) | ||
// } | ||
ValidationPluginInstance.prototype.getRulesAndNested = function (path) { | ||
@@ -24,3 +20,3 @@ var result = this.storeRules; | ||
}); | ||
return [result && result[PluginID] ? Array.from(Object.values(result[PluginID])) : [], | ||
return [result && result[PluginID] ? Array.from(result[PluginID].values()) : [], | ||
result ? Object.keys(result) : []]; | ||
@@ -86,5 +82,2 @@ }; | ||
if (Array.isArray(nestedInst)) { | ||
// only validation for all array elements is supported | ||
// because of this limitation, it is expected that the first element is '*' | ||
// if any rules are defined | ||
if (nestedRulesKeys.includes('*')) { | ||
@@ -91,0 +84,0 @@ for (var i = 0; i < nestedInst.length; i += 1) { |
{ | ||
"name": "@hookstate/validation", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Plugin for @hookstate/core to enable validation of data state.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
45779
361