tools/kevoree-kevscript/lib/util/model-helper.js
function isCompatible(tdef, node) {
	if (tdef && node) {
		if (tdef.select('metaData[name=virtual]').array.length > 0) {
			// tdef is virtual, so it is compatible
			return true;

		} else {
			const nodePlatforms = getPlatforms(node.typeDefinition);

			for (let i = 0; i < nodePlatforms.length; i++) {
				if (tdef.select('deployUnits[name=*]/filters[name=platform,value=' + nodePlatforms[i] + ']').array.length > 0) {
					return true;
				}
			}
		}
	}
	return false;
}
function isCompatible(tdef, node) {
	if (tdef && node) {
		if (tdef.select('metaData[name=virtual]').array.length > 0) {
			// tdef is virtual, so it is compatible
			return true;

		} else {
			const nodePlatforms = getPlatforms(node.typeDefinition);

			for (let i = 0; i < nodePlatforms.length; i++) {
				if (tdef.select('deployUnits[name=*]/filters[name=platform,value=' + nodePlatforms[i] + ']').array.length > 0) {
					return true;
				}
			}
		}
	}
	return false;
}
function isCompatible ( tdef , node ) { if ( tdef && node ) { if ( tdef . select ( 'metaData[name=virtual]' ) . array . length > 0 ) { // tdef is virtual, so it is compatible return true ; } else { const nodePlatforms = getPlatforms ( node . typeDefinition ) ; for ( let i = 0 ; i < nodePlatforms . length ; i ++ ) { if ( tdef . select ( 'deployUnits[name=*]/filters[name=platform,value=' + nodePlatforms [ i ] + ']' ) . array . length > 0 ) { return true ; } } } } return false ; }
Returns whether or not the given "tdef" is compatible with the given "node"
if the tdef has a platform compatible with the node type
@param tdef
@param node
@returns {Boolean}
Returns whether or not the given tdef is compatible with the given node if the tdef has a platform compatible with the node type