spiff-arena/bpmn-js-spiffworkflow/app/spiffworkflow/helpers.js

15 lines
395 B
JavaScript
Raw Normal View History

// https://stackoverflow.com/a/5767357/6090676
export function removeFirstInstanceOfItemFromArrayInPlace(arr, value) {
const index = arr.indexOf(value);
if (index > -1) {
arr.splice(index, 1);
}
return arr;
}
export function removeExtensionElementsIfEmpty(moddleElement) {
if (moddleElement.extensionElements.values.length < 1) {
moddleElement.extensionElements = null;
}
}