Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MatsJohansen87 committed Oct 12, 2023
2 parents 58303e8 + 1ba469b commit dfbd1ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const resolveOperation = (operation: AstElement): string => {
}

'children' in operation && operation.children.forEach((element: AstElement, index) => {
console.log(element);
if ('children' in element) {
expression += resolveOperation(element)
}
Expand All @@ -92,6 +93,7 @@ const resolveOperation = (operation: AstElement): string => {

const getSingleton = (criterion: AstBottomLayerValue): string => {
let expression: string = "";
console.log(criterion)
const myCriterion = criterionMap.get(criterion.key)

if (myCriterion) {
Expand Down
23 changes: 12 additions & 11 deletions packages/lib/src/helpers/ast-transformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,17 +85,6 @@ if (Array.isArray(item)) {
}
}

/**
* return bottom level object of an entity (aggregatedValue)
*/
if ('key' in topLayerItem && 'value' in item && typeof item.value === 'string') {
return {
key: topLayerItem.key,
type: 'EQUALS',
system: '',
value: item.value,
}
}
/**
* return bottom level object of other QueryValues (string | {min: number, max: number})
*/
Expand All @@ -107,6 +96,18 @@ if (Array.isArray(item)) {
value: item.value,
}
}

/**
* return bottom level object of an entity (aggregatedValue)
*/
if ('value' in item && typeof item.value === 'string') {
return {
key: item.value,
type: 'EQUALS',
system: '',
value: item.name,
}
}

return
}

0 comments on commit dfbd1ee

Please sign in to comment.