google-books-search-2
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -50,18 +50,4 @@ /** | ||
// Validate options | ||
if (!query) { | ||
reject(new Error("Query is required")); | ||
return; | ||
} | ||
var options = extend(defaultOptions, options || {}); | ||
if (options.offset < 0) { | ||
reject(new Error("Offset cannot be below 0")); | ||
return; | ||
} | ||
if (options.limit < 1 || options.limit > 40) { | ||
reject(new Error("Limit must be between 1 and 40")); | ||
return; | ||
} | ||
// Set any special keywords | ||
@@ -72,4 +58,2 @@ if (options.field) { | ||
var options = extend(defaultOptions, options || {}); | ||
// Create the request uri | ||
@@ -93,2 +77,18 @@ var queryUrl = { | ||
// Validate options | ||
if (!query) { | ||
reject(new Error("Query is required")); | ||
return; | ||
} | ||
if (options.offset < 0) { | ||
reject(new Error("Offset cannot be below 0")); | ||
return; | ||
} | ||
if (options.limit < 1 || options.limit > 40) { | ||
reject(new Error("Limit must be between 1 and 40")); | ||
return; | ||
} | ||
// Send Request | ||
@@ -95,0 +95,0 @@ https.get(uri, function (response) { |
{ | ||
"name": "google-books-search-2", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "A node wrapper for the Google Books API. Based on the original project google-books-search.", | ||
@@ -13,2 +13,4 @@ "main": "./lib/google-books-search.js", | ||
"devDependencies": { | ||
"chai": "^3.0.0", | ||
"chai-as-promised": "^5.1.0", | ||
"mocha": "1.x.x", | ||
@@ -18,3 +20,3 @@ "should": "0.6.x" | ||
"scripts": { | ||
"test": "make test" | ||
"test": "mocha --timeout 10000 --reporter spec" | ||
}, | ||
@@ -21,0 +23,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
38387
4
17