Jon Herron 1d3a492179 Squashed 'bpmn-js-spiffworkflow/' content from commit b3eef6e5
git-subtree-dir: bpmn-js-spiffworkflow
git-subtree-split: b3eef6e52cb91d10081f1586dc035701956f93a9
2022-10-12 10:21:19 -04:00

15 lines
395 B
JavaScript

// 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;
}
}