FormidableLabs / appr

Open React Native PR Builds instantly on device
MIT License
381 stars 38 forks source link

Regexp replace is incorrect. #35

Closed giautm closed 4 years ago

giautm commented 6 years ago

This regexp missing flag g so it only replaces first characters https://github.com/FormidableLabs/appr/blob/7073907b3c5d1e85ad76b575852efbb936b69541/scripts/utils.js#L5 Example:

'my-app-@giautm/@signature'.replace(/[^a-zA-Z0-9\\-]/, '-')
"my-app--giautm/@signature"