New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

siguex

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

siguex - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "siguex",
"version": "0.0.1",
"version": "0.0.2",
"description": "Make the communication with sigue much easier",

@@ -5,0 +5,0 @@ "main": "siguex.js",

const login = require('./src/login')
module.exports = Object.freeze({ login })
class Siguex {
constructor (token, { setToken, clearToken }) {
this.token = token
this.setTokenCallback = setToken
this.clearTokenCallback = clearToken
}
setToken (token) {
this.token = token
this.setTokenCallback(token)
}
clearToken () {
delete this.token
this.clearTokenCallback()
}
}
[login].forEach((method) => {
Siguex.prototype[method.name] = function () {
return method.apply(this, Array.from(arguments).concat(this.token))
}
})
module.exports = Siguex

@@ -32,3 +32,3 @@ const dependencies = {

module.exports = function login (username, password, injection) {
module.exports = function login (username, password, token, injection) {
const {

@@ -35,0 +35,0 @@ http,

@@ -36,3 +36,3 @@ const { expect } = require('chai')

prepareMocks(nonSuccessResponse)
return login(username, password, dependencies).then(result => {
return login(username, password, null, dependencies).then(result => {
expect(result.success).to.equal(false)

@@ -45,3 +45,3 @@ expect(result.token).to.equal(undefined)

prepareMocks(successResponse)
return login(username, password, dependencies).then(result => {
return login(username, password, null, dependencies).then(result => {
expect(result.success).to.equal(true)

@@ -48,0 +48,0 @@ expect(result.token).to.equal(token)

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