Compare commits
No commits in common. "08a526ad4a00f0bf73caad8cc01ebf2221ce41c4" and "8670aca62751a12b3af458b6e40762ed5d8994e6" have entirely different histories.
08a526ad4a
...
8670aca627
@ -107,6 +107,17 @@ class IgniteProperty {
|
||||
//Get the old value
|
||||
var old = this._value;
|
||||
|
||||
//Based on the old value, see if we need to convert the new value to match the original type.
|
||||
if (typeof old === typeof true) {
|
||||
val = val != null && val != undefined ? val.toString().toLowerCase().trim() : val;
|
||||
val = val == "true" || val == "1" || val == "yes" || val == "t" || val == "y";
|
||||
} else if (typeof old === typeof 0) {
|
||||
val = Number(val != null && val != undefined ? val.toString().trim() : "0");
|
||||
val = isNaN(val) ? 0 : val;
|
||||
} else if (typeof old === typeof "") {
|
||||
val = val != null && val != undefined ? val.toString() : null;
|
||||
}
|
||||
|
||||
//Set the new value
|
||||
this._value = val;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user