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

cypher-stream

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypher-stream - npm Package Compare versions

Comparing version 0.1.6 to 0.1.7

21

index.js

@@ -7,4 +7,17 @@ var oboe = require('oboe');

// recursively replace each node with its data property if available
function extractData(item) {
return item.data;
if(item.data) {
return extractData(item.data);
}
var isArrayOrObject = ['array', 'object'].indexOf(typeof item) !== -1;
if(!isArrayOrObject) {
// filter only objects and arrays
return item;
}
// recurse on each property
Object.keys(item).forEach(function(key){
item[key] = extractData(item[key]);
});
return item;
}

@@ -30,7 +43,3 @@

columns.forEach(function (column, i) {
if(result[i].length && result[i][0].data) {
data[column] = result[i].map(extractData);
return;
}
data[column] = result[i].data || result[i];
data[column] = extractData(result[i]);
});

@@ -37,0 +46,0 @@ stream.push(data);

{
"name": "cypher-stream",
"version": "0.1.6",
"version": "0.1.7",
"description": "Streams cypher query results in a clean format",

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

@@ -98,2 +98,11 @@ var should = require('should');

it('recursively returns data values', function (done) {
cypher('match (n:Test) return { child: { grandchild: n }} as parent limit 1')
.on('data', function (result) {
result.should.eql({ parent: { child: { grandchild: { test: true } } } });
})
.on('end', done)
;
});
});
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