UNPKG

@neo4j/cypher-builder

Version:

A programmatic API for building Cypher queries for Neo4j

36 lines (35 loc) 874 B
"use strict"; /* * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] */ Object.defineProperty(exports, "__esModule", { value: true }); exports.ConcatOp = void 0; exports.concat = concat; const CypherASTNode_1 = require("../../CypherASTNode"); const ConcatOperator = "||"; /** * The concatenation operator (`||`) generated by {@link concat} * @group Operators * @category String */ class ConcatOp extends CypherASTNode_1.CypherASTNode { exprs; /** @internal */ constructor(exprs) { super(); this.exprs = exprs; } /** * @internal */ getCypher(env) { const exprs = this.exprs.map((e) => e.getCypher(env)); const operatorStr = ` ${ConcatOperator} `; return `(${exprs.join(operatorStr)})`; } } exports.ConcatOp = ConcatOp; function concat(...exprs) { return new ConcatOp(exprs); }