new-dblapi
Advanced tools
Comparing version 1.2.2 to 1.2.3
@@ -105,4 +105,7 @@ const http = require('http') | ||
if(res.statusCode == 401) throw new Error("Unauthorized, invalid DBL token.") | ||
else if(res.statusCode == 404) throw new Error("404, not found. (Invalid id?)") | ||
else if(res.statusCode == 403) throw new Error("403, forbidden") | ||
else if(res.statusCode == 400) throw new Error("Bad request") | ||
res.on('data', (d) => { | ||
if(res.statusCode == 200){ | ||
if(res.statusCode.toString().startsWith("2")){ | ||
data += d | ||
@@ -142,3 +145,4 @@ }else{ | ||
} | ||
return await this.request(opts) | ||
let req = await this.request(opts) | ||
return await JSON.parse(req) | ||
} | ||
@@ -168,3 +172,4 @@ | ||
} | ||
return await JSON.parse(this.request(opts)) | ||
let req = await this.request(opts) | ||
return await JSON.parse(req) | ||
} | ||
@@ -200,3 +205,4 @@ | ||
} | ||
return await JSON.parse(this.request(opts)) | ||
let req = await this.request(opts) | ||
return await JSON.parse(req) | ||
} | ||
@@ -242,3 +248,4 @@ | ||
} | ||
return await this.request(opts) | ||
let req = await this.request(opts) | ||
return await JSON.parse(req) | ||
} | ||
@@ -245,0 +252,0 @@ |
{ | ||
"name": "new-dblapi", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "A new dbl api.", | ||
@@ -5,0 +5,0 @@ "main": "dblapi.js", |
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
21892
395