Skip to content

Structured random #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Aug 3, 2025
Merged

Structured random #1

merged 11 commits into from
Aug 3, 2025

Conversation

streamich
Copy link
Collaborator

No description provided.

Specifies all templates for generating structured JSON data.

```ts
export type Template =
  | LiteralTemplate
  | NumberTemplate
  | IntegerTemplate
  | FloatTemplate
  | StringTemplate
  | BooleanTemplate
  | NullTemplate
  | ArrayTemplate
  | ObjectTemplate
  | OrTemplate;
```
Example:

```ts
const str = TemplateJson.gen(['str', ['pick', ['foo', 'bar', 'baz']]]);
```
Example:

```ts
const int = TemplateJson.gen(['int', -10, 10])
```
- Add MapTemplate type to TemplateNode union and TemplateShorthand
- Implement generateMap method in TemplateJson class
- Handle 'map' shorthand in generate method
- Support custom key tokens, value templates, and min/max constraints
- Respect maxNodes limit for map generation
- Add comprehensive test suite covering all map functionality
- Add demo showcasing various map use cases
- Fix import type declarations for better tree-shaking
@streamich streamich merged commit 49e341a into master Aug 3, 2025
2 checks passed
@streamich streamich deleted the structured-random branch August 3, 2025 11:35
Copy link

github-actions bot commented Aug 3, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant