UNPKG

@salesforce/soql-model

Version:
29 lines 1.17 kB
"use strict"; /* * Copyright (c) 2020, salesforce.com, inc. * All rights reserved. * Licensed under the BSD 3-Clause license. * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ Object.defineProperty(exports, "__esModule", { value: true }); exports.InListConditionImpl = void 0; const soqlModelObjectImpl_1 = require("./soqlModelObjectImpl"); class InListConditionImpl extends soqlModelObjectImpl_1.SoqlModelObjectImpl { constructor(field, operator, values) { super(); this.field = field; this.operator = operator; this.values = values; } toSoqlSyntax(options) { let valuesSyntax = ''; this.values.forEach((value) => (valuesSyntax = `${valuesSyntax}, ${value.toSoqlSyntax(options)}`)); if (valuesSyntax.length > 2) { // remove comma separator at start of string valuesSyntax = valuesSyntax.substring(2); } return `${this.field.toSoqlSyntax(options)} ${this.operator} ( ${valuesSyntax} )`; } } exports.InListConditionImpl = InListConditionImpl; //# sourceMappingURL=inListConditionImpl.js.map