generatePixKey function exported ✓ 100.0%

Last updated: 2026-02-24T21:07:57.529Z

Metrics

LOC: 15 Complexity: 5 Params: 0 Coverage: 100.0% (7/7 lines, 21x executed)

Signature

generatePixKey(): : string

Summary

Generates a random PIX key (CPF, email, phone, or UUID format).

Tags

#@returns A randomly typed PIX key string

Source Code

export function generatePixKey(): string {
  const types = ["cpf", "email", "phone", "random"] as const;
  const type = faker.helpers.arrayElement(types);

  switch (type) {
    case "cpf":
      return faker.string.numeric(11);
    case "email":
      return faker.internet.email();
    case "phone":
      return `+55${faker.string.numeric(11)}`;
    case "random":
      return faker.string.uuid();
  }
}

No outgoing dependencies.

Impact (Incoming)

graph LR generatePixKey["generatePixKey"] GeneratorFn["GeneratorFn"] GeneratorFn -->|calls| generatePixKey style generatePixKey fill:#dbeafe,stroke:#2563eb,stroke-width:2px click generatePixKey "f18ebf6996413b23.html" click GeneratorFn "07e2c388ba1ac3f3.html"
SourceType
GeneratorFn calls