- convert regexp flags-str to a int compatible-with-v8
- refer to : v8/src/regexp/regexp-flags.h
- npm install nv-regexp-flags
const { n2s,s2n} = require("nv-regexp-flags");
var rgx = /a/gi;
> rgx.flags
/*"gi"*/
> s2n("gi")
3
> s2n("g")
1
> s2n("i")
2
>
> n2s(3)
'gi'
> n2s(1)
'g'
> n2s(2)
'i'
- ISC