Comparing version 2.1.0 to 2.1.1
@@ -24,2 +24,6 @@ var _ = require('lodash'); | ||
function _statusOk(body) { | ||
return !!body && !!body.response && body.response.status === 'OK'; | ||
} | ||
function Api(config) { | ||
@@ -48,3 +52,3 @@ this._config = _.defaults({}, config, { | ||
// Validate Opts | ||
_(opts).pick(['startElement', 'numElements']).each(function (value, opt) { | ||
_.forEach(_.pick(opts, ['startElement', 'numElements']), function (value, opt) { | ||
if (_hasValue(value) && !_isInteger(value)) { | ||
@@ -222,2 +226,4 @@ return reject(new Error('invalid ' + opt + ': ' + value)); | ||
Api.statusOk = _statusOk; | ||
module.exports = Api; |
@@ -429,3 +429,17 @@ var _ = require('lodash'); | ||
describe('#statusOk', function () { | ||
it('should be tested'); | ||
it('should return true when status is OK', function () { | ||
assert.equal(Api.statusOk({ response: { status: 'OK' } }), true); | ||
}); | ||
it('should return false when status is not OK', function () { | ||
assert.equal(Api.statusOk({ response: { status: '' } }), false); | ||
}); | ||
it('should return false with no status field', function () { | ||
assert.equal(Api.statusOk({ response: {} }), false); | ||
}); | ||
it('should return false with no response field', function () { | ||
assert.equal(Api.statusOk({}), false); | ||
}); | ||
}); | ||
@@ -432,0 +446,0 @@ |
@@ -111,9 +111,4 @@ var _ = require('lodash'); | ||
function statusOk(body) { | ||
return body && body.response && body.response.status === 'OK'; | ||
} | ||
function extend(ns) { | ||
ns = ns || {}; | ||
ns.statusOk = statusOk; | ||
ns.ApiError = ApiError; | ||
@@ -128,3 +123,2 @@ ns.NotAuthorizedError = NotAuthorizedError; | ||
module.exports = { | ||
statusOk: statusOk, | ||
ApiError: ApiError, | ||
@@ -131,0 +125,0 @@ NotAuthorizedError: NotAuthorizedError, |
{ | ||
"name": "anx-api", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "AppNexus Api Wrapper", | ||
@@ -21,2 +21,3 @@ "homepage": "https://github.com/appnexus/anx-api", | ||
"author": "Tim Santeford", | ||
"license": "Apache-2.0", | ||
"contributors": [ | ||
@@ -43,5 +44,5 @@ { | ||
"dependencies": { | ||
"lodash": "^2.4.1", | ||
"q": "^1.1.1", | ||
"qs": "^2.3.3", | ||
"lodash": "^3.10.1", | ||
"q": "^1.4.1", | ||
"qs": "^5.1.0", | ||
"request": "^2.48.0" | ||
@@ -53,6 +54,6 @@ }, | ||
"gulp-mocha": "^2.1.3", | ||
"istanbul": "^0.3.17", | ||
"mocha": "^2.2.5", | ||
"nock": "^0.50.0", | ||
"istanbul": "^0.3.17" | ||
"nock": "^2.13.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
NPM Shrinkwrap
Supply chain riskPackage contains a shrinkwrap file. This may allow the package to bypass normal install procedures.
Found 1 instance in 1 package
0
73709
20
1071
+ Addedlodash@3.10.1(transitive)
+ Addedqs@5.2.1(transitive)
- Removedlodash@2.4.2(transitive)
- Removedqs@2.4.2(transitive)
Updatedlodash@^3.10.1
Updatedq@^1.4.1
Updatedqs@^5.1.0