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

stackexchange

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stackexchange - npm Package Compare versions

Comparing version 0.4.0 to 1.0.0-0

8

lib/methods/answers.js

@@ -7,5 +7,3 @@ 'use strict';

var query = require('../query')
, post = require('../post')
, Logger = require('devnull')
, log = new Logger({ timestamp: false });
, post = require('../post');

@@ -38,3 +36,3 @@

if(!criteria['key'] || !criteria['access_token']) {
return log.error('answers.upvote lacks key and/or access token as criteria');
return callback(new Error('answers.upvote lacks key and/or access token as criteria'));
}

@@ -57,3 +55,3 @@ undo = undo? "/undo" : "";

if(!criteria['key'] || !criteria['access_token']) {
return log.error('answers.upvote lacks key and/or access token as criteria');
return callback(new Error('answers.upvote lacks key and/or access token as criteria'));
}

@@ -60,0 +58,0 @@ undo = undo? "/undo" : "";

@@ -7,5 +7,3 @@ 'use strict';

var query = require('../query')
, post = require('../post')
, Logger = require('devnull')
, log = new Logger({ timestamp: false });
, post = require('../post');

@@ -35,3 +33,3 @@

function answers (criteria, callback, ids) {
if (!ids || !ids.length) return log.error('questions.answers lacks IDs to query');
if (!ids || !ids.length) return callback(new Error('questions.answers lacks IDs to query'));
query('questions/' + ids.join(';') + '/answers', criteria, callback);

@@ -52,3 +50,3 @@ }

if(!criteria['key'] || !criteria['access_token']) {
return log.error('questions.upvote lacks key and/or access token as criteria');
return callback(new Error('questions.upvote lacks key and/or access token as criteria'));
}

@@ -71,3 +69,3 @@ undo = undo? "/undo" : "";

if(!criteria['key'] || !criteria['access_token']) {
return log.error('questions.upvote lacks key and/or access token as criteria');
return callback(new Error('questions.upvote lacks key and/or access token as criteria'));
}

@@ -74,0 +72,0 @@ undo = undo? "/undo" : "";

@@ -6,5 +6,3 @@ 'use strict';

*/
var query = require('../query')
, Logger = require('devnull')
, log = new Logger({ timestamp: false });
var query = require('../query');

@@ -20,3 +18,3 @@ /**

function answers (criteria, ids, callback) {
if (!ids || !ids.length) return log.error('users.answers lacks IDs to query');
if (!ids || !ids.length) return callback(new Error('users.answers lacks IDs to query'));
query('users/' + ids.join(';') + '/answers', criteria, callback);

@@ -23,0 +21,0 @@ }

@@ -6,5 +6,3 @@ 'use strict';

, request = require('request')
, url = require('url')
, Logger = require('devnull')
, log = new Logger({ timestamp: false });
, url = require('url');

@@ -21,3 +19,3 @@

module.exports = function post (destination, data, callback) {
if (!callback) return log.critical('No callback supplied for: ' + destination);
if (!callback) throw new Error('No callback supplied for: ' + destination);

@@ -24,0 +22,0 @@ // Query against the predefined website and construct the endpoint.

@@ -6,5 +6,3 @@ 'use strict';

, request = require('request')
, url = require('url')
, Logger = require('devnull')
, log = new Logger({ timestamp: false });
, url = require('url');

@@ -20,3 +18,3 @@ /**

module.exports = function query (destination, criteria, callback) {
if (!callback) return log.critical('No callback supplied for: ' + destination);
if (!callback) throw new Error('No callback supplied for: ' + destination);

@@ -23,0 +21,0 @@ // Query against the predefined website and construct the endpoint.

{
"name": "stackexchange",
"version": "0.4.0",
"version": "1.0.0-0",
"description": "Node.js implementation of the stackexchange/stackoverflow API",

@@ -15,12 +15,10 @@ "main": "./lib/stackexchange",

"nconf": "0.8.x",
"request": "2.72.x",
"devnull": "0.0.x",
"request": "^2.87.0",
"utile": "0.3.x"
},
"devDependencies": {
"mocha": "2.5.x",
"chai": "3.5.x",
"sinon": "1.17.x",
"sinon-chai": "2.8.x",
"pre-commit": "1.1.x"
"chai": "^4.1.2",
"mocha": "^5.2.0",
"sinon": "^4.5.0",
"sinon-chai": "^3.1.0"
},

@@ -27,0 +25,0 @@ "keywords": [

@@ -7,2 +7,2 @@ global.chai = require('chai');

global.chai.use(global.sinonChai);
global.chai.Assertion.includeStack = true;
global.chai.config.includeStack = true;

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