Socket
Socket
Sign inDemoInstall

hapi-csv

Package Overview
Dependencies
Maintainers
2
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-csv - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

coverage.html

10

lib/index.js

@@ -34,5 +34,11 @@ 'use strict';

const acceptHeader = request.headers.accept;
const isTextCsvAcceptHeader = acceptHeader.indexOf('text/csv') > -1;
const isApplicationCsvAcceptHeader = acceptHeader.indexOf('application/csv') > -1;
let isTextCsvAcceptHeader = false;
let isApplicationCsvAcceptHeader = false;
if (acceptHeader) {
isTextCsvAcceptHeader = acceptHeader.indexOf('text/csv') > -1;
isApplicationCsvAcceptHeader = acceptHeader.indexOf('application/csv') > -1;
}
if (internals.routeMap.has(request.route.path) && (isApplicationCsvAcceptHeader || isTextCsvAcceptHeader)) {

@@ -39,0 +45,0 @@ const schema = internals.routeMap.get(request.route.path);

0

LICENSE.txt

@@ -0,0 +0,0 @@ The MIT License (MIT)

{
"name": "hapi-csv",
"version": "2.1.0",
"version": "2.1.1",
"description": "Hapi plugin for converting a Joi response schema and dataset to csv",

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

@@ -0,0 +0,0 @@ # Hapi-csv

@@ -114,3 +114,20 @@ 'use strict';

server.stop(done);
server.inject({
'method': 'GET',
'url': '/user',
'headers': {
'Accept': ''
}
}, (getResponseNoAcceptHeaders) => {
expectedResult = {
first_name: 'firstName',
last_name: 'lastName',
age: 25
};
expect(getResponseNoAcceptHeaders.result).to.equal(expectedResult);
server.stop(done);
});
});

@@ -117,0 +134,0 @@ });

Sorry, the diff of this file is not supported yet

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