samchon / typia

Super-fast/easy runtime validators and serializers via transformation
https://typia.io/
MIT License
4.61k stars 158 forks source link

Could be replace randexp with something else? #944

Open EloB opened 9 months ago

EloB commented 9 months ago

Feature Request

The randexp seems like an unmaintained repo. It's using CJS that is bad for dead code elimination. Also has some old dependencies that also seems to be unmaintained. https://github.com/fent/randexp.js

Made a PR to try to add sideEffects: false to them without any response.

What do you think?

samchon commented 9 months ago

Do you know something to recommend?

I also hope to change to another one. When complicate regular expression comes, randexp generates wrong string value which even cannot pass the RegExp.test(string) function of itself.

Namchee commented 9 months ago

Might give reregexp a shot. It does have limitations though.

EloB commented 9 months ago

@samchon I never used such feature before. The only thing I would like is something that is ESM because it's better for dead code elimination.

samchon commented 5 months ago

@EloB https://github.com/samchon/typia/pull/1099 This PR and v6.1 update may solve your issue.

ryoppippi commented 4 months ago

@samchon I think we still need to consider the alternative for randexp. Bundling is fine for now, but we need to find something.

So this issue still needs be opened!

ryoppippi commented 4 months ago

randexp is really great for bundle size, but reregep looks good

ryoppippi commented 4 months ago

I'm considering if magic-regexp implements zero-runtime random generator.

AlexRMU commented 3 months ago
AlexRMU commented 2 months ago

See also: https://github.com/google/intermock https://github.com/faker-js/faker https://github.com/boo1ean/casual https://github.com/ngneat/falso https://github.com/g45t345rt/minifaker https://github.com/chancejs/chancejs https://github.com/w3tecch/typeorm-seeding https://github.com/json-schema-faker/json-schema-faker

ryoppippi commented 2 months ago

@AlexRMU Thank you for your investigation. We are finding a randome generator with these specs.

e.g. I found this library today copycat, but this cannot generate random string from regex