Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return (element, extensionElements, value, idx) => {
const inputOutput = getInputOutput(element);
const parameter = getter(element, idx);
const commands = [];
commands.push(cmdHelper.removeElementsFromList(element, inputOutput, prop, null, [ parameter ]));
const firstLength = inputOutput.get(prop).length-1;
const secondLength = (inputOutput.get(otherProp) || []).length;
if (!firstLength && !secondLength) {
commands.push(extensionElementsHelper.removeEntry(getBusinessObject(element), element, inputOutput));
}
return commands;
};
};
return (element, extensionElements, value, idx) => {
const payloadMappings = getPayloadMappings(element);
const parameter = getter(element, idx);
const commands = [];
commands.push(cmdHelper.removeElementsFromList(element, payloadMappings, prop, null, [parameter]));
const firstLength = payloadMappings.get(prop).length - 1;
if (!firstLength) {
commands.push(extensionElementsHelper.removeEntry(getBusinessObject(element), element, payloadMappings));
}
return commands;
};
};