Socket
Socket
Sign inDemoInstall

hapi-csv

Package Overview
Dependencies
Maintainers
3
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 3.1.1 to 4.0.0

test/index.js

23

lib/index.js

@@ -38,3 +38,3 @@ 'use strict';

if (path.endsWith('.csv')) {
request.setUrl(`${path.substring(0, path.length - 4)}${request.url.search}`);
request.setUrl(`${path.substring(0, path.length - 4)}${request.url.search ? request.url.search : ''}`);
request.headers.accept = 'text/csv';

@@ -61,5 +61,5 @@ }

const result = allowedTypesRegex.exec(request.headers.accept);
const preferedType = result && result[0];
const preferredType = result && result[0];
if (!(preferedType && internals.routeMap.has(internals.createRouteMethodString(request.route.path, request.route.method)))) {
if (!(preferredType && internals.routeMap.has(internals.createRouteMethodString(request.route.path, request.route.method)))) {
return reply.continue();

@@ -95,5 +95,5 @@ }

// var response = reply(csv);
// response.type(`${preferedType}; charset=${response.settings.charset}; header=present;`);
// response.type(`${preferredType}; charset=${response.settings.charset}; header=present;`);
return reply(csv).type(preferedType).header('content-disposition', 'attachment;');
return reply(csv).type(preferredType).header('content-disposition', 'attachment;');
});

@@ -261,3 +261,3 @@ });

else {
temp = internals.dateToISOstring(temp);
temp = internals.dateToISOString(temp);
dataRow += `"${internals.escapeQuotesInString(temp)}"`;

@@ -284,10 +284,9 @@ }

internals.dateToISOstring = (str) => {
internals.dateToISOString = (str) => {
if (str instanceof Date) {
if (str instanceof Date) {
return str.toISOString();
}
return str.toISOString();
}
return str;
return str;
};

@@ -294,0 +293,0 @@

{
"name": "hapi-csv",
"version": "3.1.1",
"version": "4.0.0",
"description": "Hapi plugin for converting a Joi response schema and dataset to csv",
"main": "lib/index.js",
"scripts": {
"test": "lab -a code -vL --lint-fix -t 100",
"test-cov-html": "lab -a code -vL --lint-fix -t 100 -r html -o coverage.html"
"test": "lab -a code -vL --lint-fix -t 100 -I URL,URLSearchParams"
},

@@ -21,13 +20,13 @@ "repository": {

],
"author": "Kevin De Clerck",
"author": "Salesflare Team",
"license": "MIT",
"dependencies": {
"hoek": "4.x.x",
"async": "^2.5.0"
"async": "^2.6.0",
"hoek": "5.x.x"
},
"devDependencies": {
"joi": "^11.0.0",
"code": "4.x.x",
"hapi": "16.x.x",
"lab": "14.x.x"
"hapi": "^16.6.3",
"joi": "^13.0.0",
"lab": "^14.3.4"
},

@@ -38,2 +37,5 @@ "peerDependencies": {

},
"engines": {
"node": ">=6.0.0"
},
"bugs": {

@@ -40,0 +42,0 @@ "url": "https://github.com/Salesflare/hapi-csv/issues"

@@ -1,2 +0,2 @@

# Hapi-csv [![Build Status](https://travis-ci.org/Salesflare/hapi-csv.svg?branch=master)](https://travis-ci.org/Salesflare/hapi-csv)
# hapi-csv [![Build Status](https://travis-ci.org/Salesflare/hapi-csv.svg?branch=master)](https://travis-ci.org/Salesflare/hapi-csv)

@@ -3,0 +3,0 @@ ## What

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