@narrative.io/data-collaboration-sdk-ts 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -107,7 +107,7 @@ function getFieldsFromNql(nqlObject) {
|
|
|
107
107
|
const fieldsArray = [];
|
|
108
108
|
// Extract all fields from the 'select' section and mark them as exported.
|
|
109
109
|
nqlObject.select.forEach((field) => {
|
|
110
|
-
fieldsArray.push({ field: field.field, exported: true });
|
|
110
|
+
fieldsArray.push({ field: field.field.replace('"value"', 'value').replace('"type"', 'type'), exported: true });
|
|
111
111
|
});
|
|
112
112
|
// Process all filter expressions from the 'where' section.
|
|
113
113
|
nqlObject.where.filterExpressions.forEach((expression) => {
|
|
@@ -179,7 +179,7 @@ function constructBinaryFilterExpression(filter) {
|
|
|
179
179
|
*/
|
|
180
180
|
function expressionToString(expr) {
|
|
181
181
|
if (typeof expr === 'string') {
|
|
182
|
-
return `${addParentheses(expr
|
|
182
|
+
return `${addParentheses(expr)}`;
|
|
183
183
|
}
|
|
184
184
|
else if (typeof expr === 'number') {
|
|
185
185
|
return expr.toString();
|
package/build/nql/NQLParser.js
CHANGED
|
@@ -91,7 +91,9 @@ function parseFieldFromString(fieldStr) {
|
|
|
91
91
|
database,
|
|
92
92
|
table
|
|
93
93
|
},
|
|
94
|
-
field: f.
|
|
94
|
+
field: f.map((field) => {
|
|
95
|
+
return field.replace('"value"', 'value').replace('"type"', 'type');
|
|
96
|
+
}).join('.')
|
|
95
97
|
};
|
|
96
98
|
try {
|
|
97
99
|
return NqlFieldObj.parse(field);
|
|
@@ -141,7 +143,7 @@ export function getFilterExpressionFromString(str) {
|
|
|
141
143
|
right
|
|
142
144
|
});
|
|
143
145
|
}
|
|
144
|
-
const strComparison = [' NOT IN ', ' IN ', ' NOT LIKE ', ' LIKE '];
|
|
146
|
+
const strComparison = [' NOT IN ', ' IN ', ' NOT LIKE ', ' LIKE ', ' BETWEEN '];
|
|
145
147
|
const containsStrComparison = strComparison.find((character) => str.toLowerCase().includes(character.toLowerCase()));
|
|
146
148
|
if (containsStrComparison !== undefined) {
|
|
147
149
|
const result = str.toLowerCase().split(containsStrComparison.toLowerCase());
|