typia
typia copied to clipboard
Could be replace randexp with something else?
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?
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.
Might give reregexp a shot. It does have limitations though.
@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.
@EloB https://github.com/samchon/typia/pull/1099 This PR and v6.1 update may solve your issue.
@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!
randexp
is really great for bundle size,
but reregep
looks good
I'm considering if magic-regexp
implements zero-runtime random generator.
- https://github.com/fent/randexp.js - not maintained
- https://github.com/arcanis/pxeger - not maintained
- https://github.com/arh23/strgen-js - not maintained
- https://github.com/suchjs/reregexp - unpopular It's all.
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
@AlexRMU Thank you for your investigation. We are finding a randome generator with these specs.
- small bundle size
- esm/cjs build
- ability to generate random values from reliable regexes.
e.g. I found this library today copycat, but this cannot generate random string from regex