mschema
Advanced tools
Comparing version 0.5.4 to 0.5.5
14
index.js
@@ -81,2 +81,16 @@ var mschema = {}; | ||
} | ||
// determine if any incoming data might need to be changed from an html checkbox into a boolean | ||
if (typeof value === "string" && (property === "boolean" || property.type === "boolean")) { | ||
if (value === "on") { | ||
value = true; | ||
} | ||
if (value === "off") { | ||
value = false; | ||
} | ||
if (typeof value === "undefined") { | ||
value = false; | ||
} | ||
data[propertyName] = value; | ||
} | ||
} | ||
@@ -83,0 +97,0 @@ |
{ | ||
"name": "mschema", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"keywords": ["schema", "mschema", "validator", "json", "json-schema"], | ||
@@ -5,0 +5,0 @@ "description": "A schema language for defining the structure of JSON data", |
74068
2356