cdp-edge 1.25.0 → 1.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -282,7 +282,9 @@ export default {
|
|
|
282
282
|
}
|
|
283
283
|
|
|
284
284
|
// ── Sanitização e Validação de Campos String ──────────────────────
|
|
285
|
-
|
|
285
|
+
type SanitizeResult = { error?: string; sanitized: string | null };
|
|
286
|
+
|
|
287
|
+
const SANITIZE_FIELDS: Record<string, (val: string) => SanitizeResult> = {
|
|
286
288
|
email: (val: string) => {
|
|
287
289
|
if (!isValidEmail(val)) return { error: 'email inválido (formato incorreto)' };
|
|
288
290
|
return { sanitized: val.toLowerCase().trim() };
|
|
@@ -342,8 +344,9 @@ export default {
|
|
|
342
344
|
}
|
|
343
345
|
|
|
344
346
|
// Sanitiza campos de string restantes
|
|
345
|
-
const
|
|
346
|
-
|
|
347
|
+
const TRACKING_ID_FIELDS = ['transactionId', 'fbclid', 'ttclid', 'gclid'];
|
|
348
|
+
|
|
349
|
+
for (const field of TRACKING_ID_FIELDS) {
|
|
347
350
|
const value = trackPayload[field as keyof TrackPayload];
|
|
348
351
|
if (value !== undefined && value !== null) {
|
|
349
352
|
if (typeof value !== 'string') {
|