Skip to content
Browse files

Corrected checks for NaN in metadata extractor

  • Loading branch information...
1 parent 40546fb commit b08233aed33eb0f7288c8062f08febfefc6c525c @MaxMotovilov committed
Showing with 3 additions and 3 deletions.
  1. +2 −2 backend/node/adstream-data/lib/request.js
  2. +1 −1 backend/node/adstream-data/package.json
View
4 backend/node/adstream-data/lib/request.js
@@ -110,14 +110,14 @@ function collectMeta( tpl, args, id ) {
break;
case 'number':
if( f in args ) {
- if( (sub = Number( arg( f ) )) === NaN )
+ if( Number.isNaN( sub = Number( arg( f ) ) ) )
throw d.mixin(
new Error( 'Query argument ' + f + '=' + args[f] + ' is not a number' ),
{ httpCode: 400 }
);
} else sub = tpl[f];
- if( sub != NaN ) result()[f] = sub;
+ if( !Number.isNaN( sub ) ) result()[f] = sub;
break;
case 'boolean':
if( f in args )
View
2 backend/node/adstream-data/package.json
@@ -1,6 +1,6 @@
{
"name" : "adstream-data",
- "version" : "0.1.8",
+ "version" : "0.1.9",
"description" : "Framework for adstream.data compliant services",
"author" : "Max Motovilov <max@motovilov.com>",
"main" : "index.js",

0 comments on commit b08233a

Please sign in to comment.
Something went wrong with that request. Please try again.