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

decypher

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decypher - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

2

package.json
{
"name": "decypher",
"version": "0.10.0",
"version": "0.11.0",
"description": "A handful of cypher utilities for Node.js",

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

@@ -12,2 +12,3 @@ /**

relationshipPattern = helpers.relationshipPattern,
escapeLiteralMap = helpers.escapeLiteralMap,
Expression = require('./expression.js');

@@ -17,2 +18,4 @@

var INTERPOLATION_REGEX = /{([\w\d]+)}/g;
/**

@@ -107,2 +110,21 @@ * Helpers.

// Interpolating the parameters within the query
Query.prototype.interpolate = function() {
var string = this.compile(),
params = this.params();
return string.replace(INTERPOLATION_REGEX, function(match, identifier) {
if (params.hasOwnProperty(identifier)) {
var value = params[identifier];
if (typeof value === 'object' && !Array.isArray(value))
return escapeLiteralMap(value);
else
return JSON.stringify(value);
}
return match;
});
};
// Attaching a method to the prototype for each statement

@@ -109,0 +131,0 @@ STATEMENTS.concat(['']).forEach(function(statement) {

@@ -156,2 +156,9 @@ [![Build Status](https://travis-ci.org/Yomguithereal/decypher.svg)](https://travis-ci.org/Yomguithereal/decypher)

// You can also alternatively interpolate the params into the query
// (Useful for debugging but unsafe!!!)
cypher.interpolate();
>>> `MATCH (n:Node)
WHERE n.title = "The best title"
RETURN n;`
// Note that multi words statements like `ORDER BY` have to be written in camel-case:

@@ -158,0 +165,0 @@ cypher.orderBy('n.title');

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