Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function getParametersAndCurrentValue(action: Ro.ActionMember | Ro.ActionRepresentation | Ro.InvokableActionMember, context: ContextService): Dictionary {
if (action instanceof Ro.InvokableActionMember || action instanceof Ro.ActionRepresentation) {
const parms = action.parameters();
const cachedValues = context.getDialogCachedValues(action.actionId());
const values = mapValues(parms, p => {
const value = cachedValues[p.id()];
return value === undefined ? p.default() : value;
});
return values;
}
return {};
}