Add `ifNotSet` function
goliatone opened this issue · comments
goliatone commented
Add an ifNotSet
function to conditionally set a value if not present.
We basically want to do the following in a single operation:
let statusCode = KeyPath.get(response, '$meta.statusCode', '_EMPTY_');
if (statusCode === '_EMPTY_') {
KeyPath.set(response, '$meta.statusCode', 500);
}