/**
 * Validation Data Path query generator for Variant.
 * write a JSON-Path filter similar to `?(@.culture == 'en-us' && @.segment == 'mySegment')`
 * where segment are optional.
 * @param value
 * @returns
 */
export function UmbDataPathVariantQuery(value) {
    // write a array of strings for each property, where culture must be present and segment is optional
    const filters = [`@.culture == ${value.culture ? `'${value.culture}'` : 'null'}`];
    if (value.segment !== undefined) {
        filters.push(`@.segment == ${value.segment ? `'${value.segment}'` : 'null'}`);
    }
    return `?(${filters.join(' && ')})`;
}
