Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

anx-api

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

anx-api - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

8

lib/api.js

@@ -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 @@

6

lib/errors.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc