Skip to content

fake

Module

Business and demo data — names, contact details, addresses, companies, products and lorem-style text — built on the random engine.

The fake module generates realistic business and demo data. It is built on the same seeded engine as the random module, so everything is reproducible from a seed and consistent with Filtrera’s pure semantics.

Like random, each kind can be produced as a single value or as an infinite generator for building datasets with take, select, etc.

Coherent composites

Composite records are internally consistent — not just independent draws:

  • person — the email is derived from the generated firstName/lastName (e.g. [email protected]), and all fields respect the locale.
  • companyemail and website are derived from a slug of the generated name (e.g. [email protected]), and the address is locale-coherent.
  • addresscountry is fixed per locale, and streets, cities, postal codes and phone formats all come from the same locale, so a Swedish address never has an American city.

Because composites draw multiple values from the same seeded stream per item, an entire demo dataset is reproducible from a single seed.

Localization

Every kind accepts a locale option, typed as a literal union of registered locale codes ('en' | 'sv'), so a misspelled literal locale is a compile-time error. v1 ships en (default) and sv. Lorem sentences are locale-independent.

Exports

fake Generates a fake business/demo value or an infinite generator of a given kind.