Open phormio opened 3 years ago
Yeah, we are thinking about the same to secure Ajv. It would be cool to have such an option.
This option probably belongs in ajv - this package both uses formats in some functions and also provides regular expressions that ajv uses directly, so it would have to somehow use different branches depending on ajv option...
Make sense. Probably, this issue should be moved to ajv repo.
Actually, the RE2 npm package is almost a drop-in replacement for RegExp
constructor. We are planning to monkey-patch (something like global.RegExp = RE2
) ajv on the first iteration.
According to the Ajv documentation:
Having you considered using the
re2
package to eliminate this risk? According to its documentation: