For this repo it's a straight text substitution: # to _ for all of the private properties and methods. There are no overlapping names.
I have yet to find a clean automated way to do this. Babel does the "accurate" thing and converts private properties to weak maps, but I don't need that here. The public properties perform better and use less code.
The regex for finding # but not when prefixed by & or any kind of quotation mark is (?<!['`"&])[#]. In addition to that I need all the declarations (re)moved, but I can rely on Babel for that.
For this repo it's a straight text substitution:
#
to_
for all of the private properties and methods. There are no overlapping names.I have yet to find a clean automated way to do this. Babel does the "accurate" thing and converts private properties to weak maps, but I don't need that here. The public properties perform better and use less code.
The regex for finding
#
but not when prefixed by&
or any kind of quotation mark is(?<!['`"&])[#]
. In addition to that I need all the declarations (re)moved, but I can rely on Babel for that.