DEV Community

Discussion on: Who's looking for open source contributors? (November 26th edition)

Collapse
 
qm3ster profile image
Mihail Malo

Have you considered making the builder object immutable, so that every fluent method returned a new instance, and a finalize method returned a regular RegExp?

Collapse
 
areknawo profile image
Arek Nawo

Not really. Didn't want to hit performance that hard for so simple task. But it makes me think, maybe provide something like .clone() method for cloning the already constructed RegExp and extending it later?

Thread Thread
 
qm3ster profile image
Mihail Malo

You wouldn't hit it as hard as you think, since in the absence of mutable methods you would reuse most of the tree.

Thread Thread
 
areknawo profile image
Arek Nawo

In this case, I will consider it as an option. Of course it would be quite a breaking change.