2017-01-11 14:22:32 +00:00
|
|
|
'use strict';
|
|
|
|
|
2018-03-14 20:43:53 +00:00
|
|
|
var forEach = require('min-dash').forEach;
|
2017-01-11 14:22:32 +00:00
|
|
|
|
2017-01-19 15:12:25 +00:00
|
|
|
/**
|
|
|
|
* These are the properties that should be ignored when cloning elements.
|
|
|
|
*
|
|
|
|
* @type {Array}
|
|
|
|
*/
|
|
|
|
module.exports.IGNORED_PROPERTIES = [
|
|
|
|
'lanes',
|
|
|
|
'incoming',
|
|
|
|
'outgoing',
|
|
|
|
'artifacts',
|
|
|
|
'default',
|
2017-12-07 22:12:00 +00:00
|
|
|
'flowElements',
|
|
|
|
'dataInputAssociations',
|
|
|
|
'dataOutputAssociations'
|
2017-01-19 15:12:25 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
|
2017-01-11 14:22:32 +00:00
|
|
|
function getProperties(descriptor, keepDefault) {
|
|
|
|
var properties = [];
|
|
|
|
|
|
|
|
forEach(descriptor.properties, function(property) {
|
|
|
|
|
|
|
|
if (keepDefault && property.default) {
|
|
|
|
return;
|
|
|
|
}
|
2017-01-19 15:12:25 +00:00
|
|
|
|
2017-01-11 14:22:32 +00:00
|
|
|
properties.push(property.ns.name);
|
|
|
|
});
|
|
|
|
|
|
|
|
return properties;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports.getProperties = getProperties;
|