Allow scoped packages /size/ endpoint #16
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue that disallow us to use the /size/ endpoint with npm scoped packages.
I've completely removed the regex since it was useless.
It only checked if the first character was a word character [a-zA-Z0-9_].
We can implement a better regex for it but I think that is unnecessary work for the server.
Let me know what you think!
Example of non-working badge:
![](https://camo.githubusercontent.com/d9553085d212d8c8b4b06d40cf0cf10a062d231b63066739d7e068ccd2626509/68747470733a2f2f6261646765732e6865726f6b756170702e636f6d2f73697a652f6e706d2f4067656f2d6d6170732f636f756e74726965732d6d61726974696d652d316d2f6d61702e67656f2e6a736f6e)