1
0
Fork 0
mirror of synced 2024-06-27 10:41:00 +12:00

Update form.js

This commit is contained in:
Torsten Dittmann 2021-04-06 15:40:24 +02:00 committed by GitHub
parent 7ee487a0cb
commit fd5ff9ac8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,10 @@
window.ls.container.set('form', function () { window.ls.container.set('form', function () {
function cast(value, to) { function cast(value, to) {
if (value && Array.isArray(value) && to !== 'array') {
value = value.map(element => cast(element, to));
return value;
}
switch (to) { switch (to) {
case 'int': case 'int':
case 'integer': case 'integer':
@ -118,4 +122,4 @@
} }
}, true, false); }, true, false);
})(window); })(window);