mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
65da89795a
Oxc and Rolldown currently duplicate the N-API conversion between a JavaScript `RegExp` and owned Rust data. This moves that conversion to `oxc_napi::JsRegExp`. It copies `source`, `flags`, and `lastIndex`, supports converting back to a JavaScript `RegExp`, and keeps regex compilation in each consumer. `oxc_minify_napi::JsRegExp` remains available as a re-export. This is a good place to put since Rolldown already used `oxc_napi` and crate is exactly for napi related struct