Comparing version 1.0.5 to 1.1.0
@@ -1,42 +0,3 @@ | ||
const jsonist = require('jsonist') | ||
, qs = require('querystring') | ||
, xtend = require('xtend') | ||
, ghutils = require('ghutils') | ||
const ghutils = require('ghutils') | ||
function makeOptions (auth, options) { | ||
return xtend({ | ||
headers : { 'User-Agent' : 'Magic Node.js application that does magic things' } | ||
, auth : auth ? auth.user + ':' + auth.token : null | ||
}, options) | ||
} | ||
function handler (callback) { | ||
return function responseHandler (err, data) { | ||
if (err) | ||
return callback(err) | ||
if (data.error || data.message) | ||
return callback(new Error('Error from GitHub: ' + (data.error || data.message))) | ||
callback(null, data) | ||
} | ||
} | ||
function ghget (auth, url, options, callback) { | ||
options = makeOptions(auth, options) | ||
jsonist.get(url, options, handler(callback)) | ||
} | ||
function ghpost (auth, url, data, options, callback) { | ||
options = makeOptions(auth, options) | ||
jsonist.post(url, data, options, handler(callback)) | ||
} | ||
module.exports.list = function list (auth, org, options, callback) { | ||
@@ -86,3 +47,3 @@ if (typeof org == 'function') { // list for this user | ||
ghget(auth, url, options, callback) | ||
ghutils.ghget(auth, url, options, callback) | ||
} |
{ | ||
"name": "ghrepos", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "Interact with the GitHub repos API", | ||
@@ -22,5 +22,3 @@ "main": "ghrepos.js", | ||
"dependencies": { | ||
"ghutils": "~1.2.1", | ||
"jsonist": "~1.0.2", | ||
"xtend": "~4.0.0" | ||
"ghutils": "~1.2.1" | ||
}, | ||
@@ -27,0 +25,0 @@ "devDependencies": { |
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
1
11252
174
- Removedjsonist@~1.0.2
- Removedxtend@~4.0.0