Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const operationList = targetEntities.map(targetEntity => {
const docPath = ["pool", entityName, targetEntity.id].join(".");
return retargetOperation(docPath, operation);
});
return mergeUpdateOperations(...operationList);
state: EntityState,
command: IdUpdateCommand
): GeneralUpdateOperation {
const { id, entityName, operation } = command;
if (
!PhenylStateFinder.has(state, {
entityName,
id
})
) {
throw new Error("Could not find any entity to update.");
}
const docPath = ["pool", entityName, id].join(".");
return retargetOperation(docPath, operation);
}