For ES3 compatibility and to support IE7, remove trailing commas from
each object in replacementList.
We find this module very useful (thanks!) and are starting to use it as a dependency in more and more of our frontend modules. However, we have a legacy JS build process (which we're trying to phase out) that ultimately uses the closure compiler in ES3 mode, which cannot parse trailing commas.
I appreciate that you may not wish to accept this PR, since IE7 and ES3 may not be a main concern, but I think it'd be wonderful to make this module more accessible to "edge case" users like us - PRs like #25 would also help. Perhaps a better way to achieve this is to pass the code through something like babel, but the tradeoff is extra code and a build step for this module.
For ES3 compatibility and to support IE7, remove trailing commas from each object in
replacementList
.We find this module very useful (thanks!) and are starting to use it as a dependency in more and more of our frontend modules. However, we have a legacy JS build process (which we're trying to phase out) that ultimately uses the closure compiler in ES3 mode, which cannot parse trailing commas.
I appreciate that you may not wish to accept this PR, since IE7 and ES3 may not be a main concern, but I think it'd be wonderful to make this module more accessible to "edge case" users like us - PRs like #25 would also help. Perhaps a better way to achieve this is to pass the code through something like babel, but the tradeoff is extra code and a build step for this module.