1
0
mirror of https://github.com/gsi-upm/soil synced 2024-11-14 15:32:29 +00:00

Prototype bug fixed

This commit is contained in:
Tasio Mendez 2018-05-18 15:49:29 +02:00
parent 125b7fad42
commit 3c43dc0a5b

View File

@ -53,14 +53,14 @@
return ( this > min && this <= max ) || ( min === 0 && this === 0 ); return ( this > min && this <= max ) || ( min === 0 && this === 0 );
}; };
Number.prototype.type = function() { Number.prototype.is_type = function() {
if ( typeof(this) === 'number' ) if ( typeof(this) === 'number' )
return ( Number.isInteger(this) ) ? 'int' : 'float'; return ( Number.isInteger(this) ) ? 'int' : 'float';
else else
return false; return false;
} }
String.prototype.type = function() { String.prototype.is_type = function() {
return "string"; return "string";
} }
@ -389,7 +389,7 @@
graph['nodes'].forEach(function(node) { graph['nodes'].forEach(function(node) {
for ( var att in node ) { for ( var att in node ) {
if (!required_node.includes(att)) { if (!required_node.includes(att)) {
if ( Array.isArray(node[att]) ) _helpers.push_once(models['dynamic'], { 'title': att, 'type': node[att][0][0].type() }, 'title'); if ( Array.isArray(node[att]) ) _helpers.push_once(models['dynamic'], { 'title': att, 'type': node[att][0][0].is_type() }, 'title');
else _helpers.push_once(models['static'], { 'title': att, 'type': typeof(node[att]) }, 'title'); else _helpers.push_once(models['static'], { 'title': att, 'type': typeof(node[att]) }, 'title');
} }
} }