Comparing version 2.0.0 to 2.0.1
@@ -1,8 +0,7 @@ | ||
{ | ||
"author": "lloti <dimggyt@gmail.com> (https://dim.codes)", | ||
"name": "steamapi", | ||
"description": "A nice Steam API wrapper.", | ||
"main": "index.js", | ||
"version": "2.0.0", | ||
"author": "lloti <dimggyt@gmail.com> (https://dim.codes)", | ||
"name": "steamapi", | ||
"description": "A nice Steam API wrapper.", | ||
"main": "index.js", | ||
"version": "2.0.1", | ||
"license": "MIT", | ||
@@ -12,20 +11,20 @@ "eslintConfig": { | ||
}, | ||
"keywords": [ | ||
"steam", | ||
"api", | ||
"wrapper", | ||
"steam-api", | ||
"steampowered" | ||
], | ||
"bugs": { | ||
"web": "https://github.com/lloti/node-steamapi/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/lloti/node-steamapi" | ||
}, | ||
"homepage": "https://github.com/lloti/node-steamapi#readme", | ||
"devDependencies": { | ||
"eslint-config-lloti": "github:lloti/eslint-config-lloti" | ||
} | ||
} | ||
"keywords": [ | ||
"steam", | ||
"api", | ||
"wrapper", | ||
"steam-api", | ||
"steampowered" | ||
], | ||
"bugs": { | ||
"web": "https://github.com/lloti/node-steamapi/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/lloti/node-steamapi" | ||
}, | ||
"homepage": "https://github.com/lloti/node-steamapi#readme", | ||
"devDependencies": { | ||
"eslint-config-lloti": "github:lloti/eslint-config-lloti" | ||
} | ||
} |
@@ -9,4 +9,7 @@ const Player = require('./Player'); | ||
this.game = player.gameName; | ||
this.stats = objectify(player.stats); | ||
this.achievements = objectify(player.achievements, 'achieved'); | ||
console.log(player); | ||
if (player.stats) | ||
this.stats = objectify(player.stats); | ||
if (player.achievements) | ||
this.achievements = objectify(player.achievements, 'achieved'); | ||
} | ||
@@ -13,0 +16,0 @@ } |
@@ -5,2 +5,3 @@ const { createDeflate, createGunzip } = require('zlib'); | ||
const http = require('http'); | ||
const reg = /<h1>(.*)<\/h1>/; | ||
@@ -24,3 +25,3 @@ module.exports = (url, { headers } = {}) => { | ||
op.on('data', chunk => data += String(chunk)); | ||
op.on('data', chunk => data += chunk); | ||
op.once('errror', reject); | ||
@@ -30,3 +31,3 @@ op.once('end', () => { | ||
if (res.statusCode === 403) return reject(new Error('Invalid key')); | ||
if (res.statusCode === 400) return reject(new Error(data.match(/<h1>(.*)<\/h1>/)[1])); | ||
if (res.statusCode === 400) return reject(new Error(reg.test(data) ? data.match(reg)[1] : data)); | ||
if (res.statusCode !== 200) return reject(new Error(res.statusMessage)); | ||
@@ -33,0 +34,0 @@ try { |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
23699
594
4