pastebin-js
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -16,4 +16,2 @@ 'use strict'; | ||
var conf = require('../lib/config'); | ||
var debug = function (msg) { console.log(msg); }; | ||
var noop = function () {}; | ||
@@ -24,12 +22,6 @@ /** | ||
function Pastebin(config) { | ||
// Pastebin('userkey') | ||
if (typeof config === 'string') { | ||
config = { api_dev_key : config }; | ||
} | ||
this.config = _.extend(conf.defaults, config); | ||
if (!this.config.debug) { | ||
debug = noop; | ||
} | ||
return this; | ||
@@ -43,4 +35,2 @@ } | ||
Pastebin.prototype.getPaste = function (id) { | ||
debug('[pastebin-js::getPaste] called'); | ||
if (!id) { | ||
@@ -51,3 +41,2 @@ var deferred = Q.defer(); | ||
} | ||
return method.get(conf.net.protocol + conf.net.base + conf.net.endpoint.raw + id, null); | ||
@@ -201,3 +190,2 @@ }; | ||
Pastebin.prototype.createAPIuserKey = function () { | ||
debug('[pastebin-js::createAPIuserKey] called'); | ||
var deferred = Q.defer(); | ||
@@ -262,4 +250,2 @@ | ||
Pastebin.prototype.listTrendingPastes = function () { | ||
debug('[pastebin-js::listTrendingPastes] called'); | ||
var deferred = Q.defer(); | ||
@@ -286,4 +272,2 @@ var params = { | ||
Pastebin.prototype.getUserInfo = function () { | ||
debug('[pastebin-js::getUserInfo] called'); | ||
var deferred = Q.defer(); | ||
@@ -370,4 +354,2 @@ var params = { | ||
Pastebin.prototype._parseXML = function (xml) { | ||
debug('[pastebin-js::_parseXML] called'); | ||
var deferred = Q.defer(); | ||
@@ -401,4 +383,2 @@ var xmlString = ''; | ||
Pastebin.prototype._getRequired = function (paramlist) { | ||
debug('[pastebin-js::_getRequired] called with ' + paramlist); | ||
var deferred = Q.defer(); | ||
@@ -410,6 +390,4 @@ var ret = _.filter(paramlist, function(param) { | ||
if (Object.keys(ret).length !== paramlist.length) { | ||
debug('[pastebin-js::_getRequired] reject'); | ||
deferred.reject(new Error('Missing parameters! ' + _.difference(paramlist, ret))); | ||
} else { | ||
debug('[pastebin-js::_getRequired] resolved'); | ||
ret = _.pick(this.config, paramlist); | ||
@@ -416,0 +394,0 @@ deferred.resolve(ret); |
@@ -1,5 +0,6 @@ | ||
[0.3.0](https://github.com/j3lte/pastebin-js/releases/tag/v0.3.0) / 2014-12-19 | ||
[0.3.0](https://github.com/j3lte/pastebin-js/releases/tag/v0.3.1) / 2014-12-20 | ||
================== | ||
* Refactoring all the _this && this | ||
* Removing all the console log stuff from debugging my code... whoops | ||
@@ -6,0 +7,0 @@ 0.2.0-[0.2.1](https://github.com/j3lte/pastebin-js/releases/tag/v0.2.1) / 2014-09-02 |
@@ -21,3 +21,2 @@ 'use strict'; | ||
get : function (path, params) { | ||
console.log('[pastebin-js::GET] : ' + path + ' params: ' + params); | ||
var deferred = Q.defer(); | ||
@@ -63,3 +62,2 @@ | ||
post : function (path, params, callback) { | ||
console.log('[pastebin-js::POST] : ' + path + ' params: ' + JSON.stringify(params)); | ||
var deferred = Q.defer(); | ||
@@ -66,0 +64,0 @@ |
{ | ||
"name": "pastebin-js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"npm-shrinkwrap-version": "5.1.0", | ||
@@ -5,0 +5,0 @@ "dependencies": { |
{ | ||
"name": "pastebin-js", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "NodeJS module for Pastebin API", | ||
@@ -5,0 +5,0 @@ "main": "index", |
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
40084
921