By checking count for truthiness, count=0 is excluded.
I realise that a user passing in count=0 is probably making a mistake rather than requesting no response, though semantically this check ought to be a null check rather than a truthy one. The effects are the same, as it appears Steam servers are also performing a truthy check (...&count=0 has the same response as an unspecified count); this is purely semantic.
const countInterpolation = count === null || count === undefined ? "" : `count=${count}`;
// ... interpolate the above constant / add the above expression as interpolation
Relevant: https://github.com/xDimGG/node-steamapi/commit/6447177c8db70744761fd6b670a86535f534d2dd
By checking
count
for truthiness,count=0
is excluded.I realise that a user passing in
count=0
is probably making a mistake rather than requesting no response, though semantically this check ought to be a null check rather than a truthy one. The effects are the same, as it appears Steam servers are also performing a truthy check (...&count=0
has the same response as an unspecified count); this is purely semantic.or