5 posts tagged with “validation”

Normalize Phone

Sheet phones arrive as (555) 123-4567, 555-123-4567, +1 555 123 4567, or 0071…. APIs and SMS gateways want E.164. normalizePhone(raw…

Assert Required Keys

The API call failed because row 37 had no email. Worse, it succeeded with an empty amount. assertRequiredKeys(obj, requiredKeys, opts…

Normalize an Email Address

Upserts and sheet lookups miss rows when one person typed Ada@Example.com and another stored ada@example.com. normalizeEmail trims…

Sanitize a Sheet Tab Name

setName and insertSheet reject characters Sheets reserves (: \ / ? * [ ]), and long client names blow past the 100-character tab limit…