UNPKG

@tpluscode/sparql-builder

Version:

Simple JS library to build SPARQL queries

13 lines (12 loc) 385 B
import { sparql } from '@tpluscode/rdf-string'; export function concat(current, strings, values, { wrapTemplate = false, newLineSeparator = true } = {}) { let next = sparql(strings, ...values); if (wrapTemplate) { next = sparql `( ${next} )`; } if (!current) { return next; } return sparql `${current}${newLineSeparator ? '\n' : ''} ${next}`; }