DPr00f / steam-api-node

Steam Web Api Integration
MIT License
33 stars 16 forks source link

Fix silent error when steamId is set larger than `MAX_SAFE_INTEGER` #8

Closed Majicbob closed 8 years ago

Majicbob commented 8 years ago

I came across this when I was testing this module for integration with some automation I'm working on. I pasted in the SteamID without really looking at it and didn't quote it. When I ran it I was getting incorrect or empty results.

Since all the tests were passing I looked into it some more and found it was getting silently changed when converted to a string because it was larger than MAX_SAFE_INTEGER.

I added a check in Client.setSteamId that will throw an error to prevent this and added a test to ClientSpec.

DPr00f commented 8 years ago

Nice one :+1:

DPr00f commented 8 years ago

I'll publish this later