Socket
Socket
Sign inDemoInstall

notifications-node-client

Package Overview
Dependencies
17
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 5.2.0 to 5.2.1

spec/test_files/simple.csv

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 5.2.1 - 2022-10-19
* Support strings in calls to `prepareUpload`. `fs.readFile` can return strings if an encoding is provided, and the client didn't handle these correctly.
## 5.2.0 - 2022-09-27

@@ -2,0 +6,0 @@

@@ -118,2 +118,5 @@ var ApiClient = require('./api_client');

}
if (typeof(file) === 'string') {
file = Buffer.from(file);
}
return file.toString('base64')

@@ -120,0 +123,0 @@ }

2

package.json
{
"name": "notifications-node-client",
"version": "5.2.0",
"version": "5.2.1",
"homepage": "https://docs.notifications.service.gov.uk/node.html",

@@ -5,0 +5,0 @@ "repository": {

@@ -191,2 +191,20 @@ const chai = require('chai');

});
it('should accept files as buffers (from fs.readFile with no encoding)', () => {
let fs = require('fs');
let file = fs.readFileSync('./spec/test_files/simple.csv');
expect(typeof(file)).to.equal('object')
expect(Buffer.isBuffer(file)).to.equal(true);
expect(
notifyClient.prepareUpload(file, true)
).contains({file: 'MSwyLDMKYSxiLGMK', is_csv: true})
});
it('should accept files as strings (from fs.readFile with an encoding)', () => {
let fs = require('fs');
let file = fs.readFileSync('./spec/test_files/simple.csv', 'binary');
expect(typeof(file)).to.equal('string')
expect(Buffer.isBuffer(file)).to.equal(false);
expect(
notifyClient.prepareUpload(file, true)
).contains({file: 'MSwyLDMKYSxiLGMK', is_csv: true})
});

@@ -193,0 +211,0 @@ it('should allow isCsv to be set with the old method (directly into options)', () => {

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc