All projects

2025

Type-Safe Mock Data Library

A type-safe TypeScript library that generates deterministic, seeded mock data through plugins.

TypeScriptCustom PRNGPlugin Architecture

Overview

A TypeScript library for generating mock data in tests, built around correctness and typing instead of uncontrolled randomness. The same seed always produces the same data, so test failures can be reproduced.

It is still in active development and not yet published to npm. The focus so far has been the architecture: a small, tree-shakable core with generators contributed through plugins.

What I built

  • Developed a reusable TypeScript library for deterministic, seeded mock data generation.
  • Designed a type-safe architecture using Facade, Registry and context isolation patterns.
  • Enabled locale-aware, plugin-based generators with O(1) lookup for use in tests.

Design and architecture

  • Patterns: Facade for the public API, Registry for generators and context isolation so seeds do not leak between uses.
  • Determinism: a custom seeded PRNG drives every generator.
  • Performance: stateless generators with O(1) lookup, and locale-aware data packs.