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 makeTraceDetails(
variables: Record,
sendVariableValues?: VariableValueOptions,
operationString?: string,
): Trace.Details {
const details = new Trace.Details();
const variablesToRecord = (() => {
if (sendVariableValues && 'transform' in sendVariableValues) {
const originalKeys = Object.keys(variables);
try {
// Custom function to allow user to specify what variablesJson will look like
const modifiedVariables = sendVariableValues.transform({
variables: variables,
operationString: operationString,
});
return cleanModifiedVariables(originalKeys, modifiedVariables);
} catch (e) {
// If the custom function provided by the user throws an exception,
// change all the variable values to an appropriate error message.
return handleVariableValueTransformError(originalKeys);
}
} else {