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

esdump

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esdump - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

73

elasticdump.js

@@ -139,36 +139,53 @@ var util = require("util");

if (data[i]._source.title && data[i]._source.words) {
//courtlistener
if (data[i]._source.source_type == 'courtlistener') {
//for source_type grants_*
if (data[i]._source.meta.award_floor) {
if (data[i]._source.meta.award_floor != 'none') {
data[i]._source.meta.award_floor = (typeof data[i]._source.meta.award_floor != "number") ? parseInt(data[i]._source.meta.award_floor) : data[i]._source.meta.award_floor;
} else {
delete data[i]._source.meta.award_floor;
if (data[i]._source.meta.url) {
if (!data[i]._source.title) {
var url_arr = data[i]._source.meta.url.split('/');
data[i]._source.title = capitalizeEachWord(url_arr[url_arr.length - 2].replace(/-/g, ' '));
}
data01.push(data[i]);
}
} else {
if (data[i]._source.meta.award_ceiling) {
if (data[i]._source.meta.award_ceiling != 'none') {
data[i]._source.meta.award_ceiling = (typeof data[i]._source.meta.award_ceiling != "number") ? parseInt(data[i]._source.meta.award_ceiling) : data[i]._source.meta.award_ceiling;
} else {
delete data[i]._source.meta.award_ceiling;
if (data[i]._source.title && data[i]._source.words) {
//for source_type grants_*
if (data[i]._source.meta.award_floor) {
if (data[i]._source.meta.award_floor != 'none') {
data[i]._source.meta.award_floor = (typeof data[i]._source.meta.award_floor != "number") ? parseInt(data[i]._source.meta.award_floor) : data[i]._source.meta.award_floor;
} else {
delete data[i]._source.meta.award_floor;
}
}
}
if (data[i]._source.meta.estimated_funding) {
if (data[i]._source.meta.estimated_funding != 'none') {
data[i]._source.meta.estimated_funding = (typeof data[i]._source.meta.estimated_funding != "number") ? parseInt(data[i]._source.meta.estimated_funding) : data[i]._source.meta.estimated_funding;
} else {
delete data[i]._source.meta.estimated_funding;
if (data[i]._source.meta.award_ceiling) {
if (data[i]._source.meta.award_ceiling != 'none') {
data[i]._source.meta.award_ceiling = (typeof data[i]._source.meta.award_ceiling != "number") ? parseInt(data[i]._source.meta.award_ceiling) : data[i]._source.meta.award_ceiling;
} else {
delete data[i]._source.meta.award_ceiling;
}
}
}
// clinical trial
if (data[i]._source.meta.enrollment) {
data[i]._source.meta.enrollment = (typeof data[i]._source.meta.enrollment != "number") ? parseInt(data[i]._source.meta.enrollment) : data[i]._source.meta.enrollment;
if (data[i]._source.meta.estimated_funding) {
if (data[i]._source.meta.estimated_funding != 'none') {
data[i]._source.meta.estimated_funding = (typeof data[i]._source.meta.estimated_funding != "number") ? parseInt(data[i]._source.meta.estimated_funding) : data[i]._source.meta.estimated_funding;
} else {
delete data[i]._source.meta.estimated_funding;
}
}
// clinical trial
if (data[i]._source.meta.enrollment) {
data[i]._source.meta.enrollment = (typeof data[i]._source.meta.enrollment != "number") ? parseInt(data[i]._source.meta.enrollment) : data[i]._source.meta.enrollment;
}
delete data[i]._source.top_words;
data01.push(data[i]);
}
delete data[i]._source.top_words;
data01.push(data[i]);
}

@@ -219,2 +236,8 @@ }

function capitalizeEachWord(str) {
return str.replace(/\w\S*/g, function(txt) {
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
exports.elasticdump = elasticdump;

@@ -5,3 +5,3 @@ {

"description": "from elasticdump 0.16.1",
"version": "0.0.4",
"version": "0.0.5",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

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