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

@neo4j/cypher-builder

Package Overview
Dependencies
Maintainers
7
Versions
70
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neo4j/cypher-builder - npm Package Compare versions

Comparing version 1.10.2 to 1.10.3

5

dist/expressions/map/MapProjection.d.ts
import type { CypherEnvironment } from "../../Environment";
import type { Variable } from "../../references/Variable";
import type { CypherCompilable, Expr } from "../../types";
import type { Variable } from "../../references/Variable";
import { MapExpr } from "./MapExpr";

@@ -17,3 +17,4 @@ /** Represents a Map projection

private projection;
constructor(variable: Variable, projection?: string[], extraValues?: Record<string, Expr>);
private isStar;
constructor(variable: Variable, projection?: "*" | string[], extraValues?: Record<string, Expr>);
set(values: Record<string, Expr> | string): void;

@@ -20,0 +21,0 @@ /** Converts the Map projection expression into a normal Map expression

19

dist/expressions/map/MapProjection.js

@@ -22,6 +22,6 @@ "use strict";

exports.MapProjection = void 0;
const escape_1 = require("../../utils/escape");
const is_string_1 = require("../../utils/is-string");
const serialize_map_1 = require("../../utils/serialize-map");
const MapExpr_1 = require("./MapExpr");
const is_string_1 = require("../../utils/is-string");
const escape_1 = require("../../utils/escape");
/** Represents a Map projection

@@ -38,4 +38,11 @@ * @see [Cypher Documentation](https://neo4j.com/docs/cypher-manual/current/syntax/maps/#cypher-map-projection)

this.extraValues = new Map();
this.isStar = false;
this.variable = variable;
this.projection = projection;
if (projection === "*") {
this.isStar = true;
this.projection = [];
}
else {
this.projection = projection;
}
this.setExtraValues(extraValues);

@@ -76,3 +83,7 @@ }

const extraValuesStr = (0, serialize_map_1.serializeMap)(env, this.extraValues, true);
const projectionStr = this.projection.map((p) => `.${(0, escape_1.escapeProperty)(p)}`).join(", ");
const escapedColumns = this.projection.map((p) => `.${(0, escape_1.escapeProperty)(p)}`);
if (this.isStar) {
escapedColumns.unshift(".*");
}
const projectionStr = escapedColumns.join(", ");
const commaStr = extraValuesStr && projectionStr ? ", " : "";

@@ -79,0 +90,0 @@ return `${variableStr} { ${projectionStr}${commaStr}${extraValuesStr} }`;

{
"name": "@neo4j/cypher-builder",
"version": "1.10.2",
"version": "1.10.3",
"description": "A programmatic API for building Cypher queries for Neo4j",

@@ -5,0 +5,0 @@ "exports": "./dist/index.js",

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