tessl install tessl/npm-lightdash--common@0.2231.5Shared TypeScript library for the Lightdash platform containing common types, utilities, and business logic for analytics workflows
Agent Success
Agent success rate when using this tile
72%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
66%
A utility for expanding field set references with order-preserving deduplication for data query systems.
["basic_fields*"] and a table with a set named basic_fields containing ["field1", "field2"], the function returns ["field1", "field2"]. @test["field1", "field2"] and no set references, the function returns the same list unchanged. @test["basic_set*", "field3", "field4"] where basic_set contains ["field1", "field2"], the function returns ["field1", "field2", "field3", "field4"]. @test["all_fields*", "-field2"] where all_fields contains ["field1", "field2", "field3"], the function returns ["field1", "field3"] with field2 excluded. @test["all_fields*", "-field2", "-field4"] where all_fields contains ["field1", "field2", "field3", "field4"], the function returns ["field1", "field3"]. @test["set1*", "set2*"] where set1 contains ["field1", "field2"] and set2 contains ["field2", "field3"], the function returns ["field1", "field2", "field3"] with field2 appearing only once. @test["field1", "set1*"] where set1 contains ["field1", "field2"], the function returns ["field1", "field2"] with field1 appearing only once. @test["outer_set*"] where outer_set contains ["inner_set*", "field3"] and inner_set contains ["field1", "field2"], the function returns ["field1", "field2", "field3"]. @testouter_set contains ["inner_set*", "-field2"] and inner_set contains ["field1", "field2", "field3"], the function returns ["field1", "field3"]. @test["missing_set*"], the function throws an error indicating the set was not found. @testset_a contains ["set_b*"] and set_b contains ["set_a*"], the function throws an error about circular references. @testlevel3 contains ["level2*"], level2 contains ["level1*"], and level1 contains ["field1"], the function throws an error indicating only one level of nesting is allowed. @test@generates
/**
* Represents a field set definition with a list of field names
*/
export interface FieldSetDefinition {
fields: string[];
description?: string;
}
/**
* Represents a table with available field sets
*/
export interface Table {
name: string;
sets?: Record<string, FieldSetDefinition>;
}
/**
* Expands field references that include set references (ending with *)
* and applies exclusions (starting with -)
*
* Supports one level of set nesting: a set can reference another set,
* but the referenced set cannot contain set references.
*
* @param fields - Array of field names, set references (ending with *), or exclusions (starting with -)
* @param currentTable - The table containing the sets being expanded
* @returns Expanded field list with exclusions applied and duplicates removed in order
*/
export function expandFieldsWithSets(
fields: string[],
currentTable: Table,
): string[];Provides the package containing field set expansion functionality for data modeling systems.
@satisfied-by
docs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20