Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

glesys-api

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glesys-api - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

7

CHANGELOG.md
# Changelog
## 2.2.1 (2017-06-17)
* Safer building of API URLs.
* Replaced `istanbul` with `nyc`
* Updated `got` to `7.x`.
* Updated dev dependencies.
* Tests are run on Node 8.
## 2.2.0 (2016-11-27)

@@ -3,0 +10,0 @@ * Supported Node versions are now specified in the `engines` field.

22

lib/request.js
'use strict';
const url = require('url');
const got = require('got');

@@ -16,3 +17,3 @@

get (url, data) {
get (uri, data) {
const options = {

@@ -23,8 +24,6 @@ method: 'GET',

url = this.baseUrl + url;
return this.request(url, options);
return this.request(uri, options);
}
post (url, data) {
post (uri, data) {
const options = {

@@ -35,8 +34,6 @@ body: data,

url = this.baseUrl + url;
return this.request(url, options);
return this.request(uri, options);
}
request (url, options) {
request (uri, options) {
let token = `${ this.apiUser }:${ this.apiKey }`;

@@ -46,4 +43,4 @@

* We check for Buffer.alloc since Buffer.from will always be true
* because it's inherithing from Uint8Array and checking for Buffer.alloc
* is fine as it was added at the same time.
* because it's inherithing from Uint8Array. Checking for Buffer.alloc
* is fine as it was added at the same time as Buffer.from.
*/

@@ -54,2 +51,3 @@

const fullUrl = url.resolve(this.baseUrl, uri);
const defaults = {

@@ -64,3 +62,3 @@ headers: {

return got(url, options);
return got(fullUrl, options);
}

@@ -67,0 +65,0 @@ }

{
"name": "glesys-api",
"version": "2.2.0",
"version": "2.2.1",
"description": "Node.js wrapper for the GleSYS API.",

@@ -24,19 +24,19 @@ "main": "lib/glesys.js",

"dependencies": {
"got": "^6.3.0"
"got": "^7.0.0"
},
"devDependencies": {
"coveralls": "^2.11.4",
"eslint": "^3.0.0",
"eslint-config-jwilsson": "jwilsson/eslint-config",
"istanbul": "^0.4.3",
"eslint": "^4.0.0",
"eslint-config-jwilsson": "^2.0.1",
"mocha": "^3.0.0",
"sinon": "^1.16.1"
"nyc": "^11.0.1",
"sinon": "^2.0.0"
},
"scripts": {
"cover": "istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec test && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
"cover": "nyc report --reporter=text-lcov | coveralls",
"pretest": "eslint lib test",
"test": "mocha"
"test": "nyc mocha"
},
"eslintConfig": {
"extends": "eslint-config-jwilsson/node.json"
"extends": "eslint-config-jwilsson/node"
},

@@ -43,0 +43,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc