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

@redningsselskapet/pswincom-sms-gateway

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redningsselskapet/pswincom-sms-gateway - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

lib/error-types/index.js

7

lib/sms-gateway/__tests__/sms-gateway.test.js
const SMSGateway = require('../../sms-gateway')
const { NO_REF_ERROR, LOGON_ERROR } = require('../../error-types')

@@ -22,7 +23,3 @@ const gw = SMSGateway({ user: 'user', password: 'pass', sender: 'testapp' })

.sendSms({ receiver: '4791679501', message: 'KOKO' }).catch(err => {
expect(err).toEqual(Error({
receiver: '4791679501',
status: 'failure',
error: 'logon failure'
}))
expect(err).toEqual(Error(LOGON_ERROR))
})

@@ -29,0 +26,0 @@ })

const smsGateway = require('pswincom-gateway')
const { NO_REF_ERROR, LOGON_ERROR } = require('../error-types')

@@ -18,19 +19,5 @@ module.exports = ({ user, password, sender }) => {

done: (result) => {
if (result.logon !== 'OK')
reject(
new Error({
receiver: '4791679501',
status: 'failure',
error: 'logon failure'
})
)
if (result.logon !== 'OK') reject(new Error(LOGON_ERROR))
if (!result.refs) {
reject(
new Error({
receiver: receiver,
status: 'success',
error:
'No ref. This probaly means that message did not reach its destination. Check that the number is correct.'
})
)
reject(new Error(NO_REF_ERROR))
}

@@ -37,0 +24,0 @@ resolve({

{
"name": "@redningsselskapet/pswincom-sms-gateway",
"version": "1.0.1",
"version": "1.0.2",
"description": "SMS Gateway",

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

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