@apiverve/bible
Advanced tools
Comparing version 1.0.2 to 1.0.3
23
index.js
@@ -27,4 +27,9 @@ const axios = require('axios'); | ||
async execute(query, callback) { | ||
if (!query || typeof query !== 'object') { | ||
throw new Error('Query parameters must be provided as an object.'); | ||
if(arguments.length > 1) { | ||
if (!query || typeof query !== 'object') { | ||
throw new Error('Query parameters must be provided as an object.'); | ||
} | ||
} else { | ||
callback = query; | ||
query = {}; | ||
} | ||
@@ -72,7 +77,11 @@ | ||
let url = this.baseURL; | ||
if (Object.keys(query).length > 0) { | ||
const queryString = Object.keys(query) | ||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(query[key])}`) | ||
.join('&'); | ||
url += `?${queryString}`; | ||
if(query && typeof query === 'object') | ||
{ | ||
if (Object.keys(query).length > 0) { | ||
const queryString = Object.keys(query) | ||
.map(key => `${encodeURIComponent(key)}=${encodeURIComponent(query[key])}`) | ||
.join('&'); | ||
url += `?${queryString}`; | ||
} | ||
} | ||
@@ -79,0 +88,0 @@ return url; |
{ | ||
"name": "@apiverve/bible", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Bible is a simple tool for getting bible verses. Simply provide the book, chapter, and verse, and the API will return the verse.", | ||
@@ -23,11 +23,11 @@ "main": "index.js", | ||
"devDependencies": { | ||
"mocha": "^2.3.4", | ||
"chai": "^3.4.1", | ||
"dotenv": "^2.0.0" | ||
"mocha": "^10.4.0", | ||
"chai": "^5.1.1", | ||
"dotenv": "^16.4.5" | ||
}, | ||
"dependencies": { | ||
"node-fetch": "3.3.2", | ||
"promise": "^7.1.1", | ||
"axios": "^0.15.3" | ||
"promise": "^8.3.0", | ||
"axios": "1.6.8" | ||
} | ||
} |
@@ -103,3 +103,3 @@ Bible API | ||
All usage of the mailboxlayer website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements. | ||
All usage of the APIVerve website, API, and services is subject to the [APIVerve Terms of Service](https://apiverve.com/terms) and all legal documents and agreements. | ||
@@ -106,0 +106,0 @@ --- |
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
8304
76
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.6.8(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedfollow-redirects@1.15.9(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedpromise@8.3.0(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removedaxios@0.15.3(transitive)
- Removeddebug@2.6.9(transitive)
- Removedfollow-redirects@1.0.0(transitive)
- Removedms@2.0.0(transitive)
- Removedpromise@7.3.1(transitive)
Updatedaxios@1.6.8
Updatedpromise@^8.3.0