@neo4j/cypher-builder
Version:
A programmatic API for building Cypher queries for Neo4j
17 lines (16 loc) • 537 B
JavaScript
;
/*
* Copyright (c) "Neo4j"
* Neo4j Sweden AB [http://neo4j.com]
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.compileCypherIfExists = compileCypherIfExists;
/** Compiles the cypher of an element, if the resulting cypher is not empty adds a prefix */
function compileCypherIfExists(element, env, { prefix = "", suffix = "" } = {}) {
if (!element)
return "";
const cypher = element.getCypher(env);
if (!cypher)
return "";
return `${prefix}${cypher}${suffix}`;
}