// 1. Sanitize Phone Number (Remove spaces, dashes, brackets)
// Input: "+1 (555) 123-4567" -> Output: "+15551234567"
const cleanPhone = input.phone.toString().replace(/[\s\(\)\-]/g, '');
// 2. Format Move Type (Standardize Capitalization)
// Input: "commercial" -> Output: "Commercial"
const cleanType = rawType.charAt(0).toUpperCase() + rawType.slice(1);
// 3. Return Clean Object
return {
json: {
name: input.name,
email: input.email.trim().toLowerCase(),
phone: cleanPhone,
move_type: cleanType
}
}