Salesforce Sanitize
This function transforms objects to Salesforce keys and to JavaScript keys
API
sanitize(schema: array, onConflict? = function, input: object)
This function supports currying
Valid invocations:
const transform =
const transform =
Usage
const sanitize = ;const schema = ; const opportunityMapper = module { return ;};
Handling Collisions
If your schema encounters a collision, you need to notify the salesforce team that they have a data problem.
Collisions should never be handled in service code as a long term solution.
In the interim, you can hard-code resolution to the "correct" field, but these hacks should be prioritized to be removed.