@dataloop-ai/components 0.20.78 → 0.20.79
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.
package/package.json
CHANGED
|
@@ -227,7 +227,7 @@ export function revertValueAliases(json: Data, schema: Data) {
|
|
|
227
227
|
|
|
228
228
|
const replaceAliases = (where: Data) => {
|
|
229
229
|
for (const key in where) {
|
|
230
|
-
if (typeof where[key] === 'object') {
|
|
230
|
+
if (where[key] && typeof where[key] === 'object') {
|
|
231
231
|
const val = where[key]
|
|
232
232
|
const isOperator = operatorKeys.includes(Object.keys(val)[0])
|
|
233
233
|
const isArrayOperator = ['$in', '$nin'].includes(
|
|
@@ -288,7 +288,7 @@ export function setValueAliases(json: Data, schema: Data) {
|
|
|
288
288
|
const replaceValues = (where: Data) => {
|
|
289
289
|
for (const key in where) {
|
|
290
290
|
const val = where[key]
|
|
291
|
-
if (typeof val === 'object') {
|
|
291
|
+
if (val && typeof val === 'object') {
|
|
292
292
|
const isOperator = operatorKeys.includes(Object.keys(val)[0])
|
|
293
293
|
const isArrayOperator = ['$in', '$nin'].includes(
|
|
294
294
|
Object.keys(val)[0]
|
|
@@ -13,7 +13,7 @@ export function isDatePattern(str: string) {
|
|
|
13
13
|
|
|
14
14
|
const GeneratePureValue = (value: any) => {
|
|
15
15
|
if (value === '') {
|
|
16
|
-
return
|
|
16
|
+
return
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
if (typeof value === 'string') {
|
|
@@ -140,42 +140,42 @@ export const parseSmartQuery = (
|
|
|
140
140
|
case termUpToQuote.includes('>='):
|
|
141
141
|
;[key, value] = SplitFirst(term, '>=').map((x) => x.trim())
|
|
142
142
|
pureValue = GeneratePureValue(value)
|
|
143
|
-
if (pureValue !==
|
|
143
|
+
if (pureValue !== undefined) {
|
|
144
144
|
andQuery.push({ [key]: { $gte: pureValue } })
|
|
145
145
|
}
|
|
146
146
|
break
|
|
147
147
|
case termUpToQuote.includes('<='):
|
|
148
148
|
;[key, value] = SplitFirst(term, '<=').map((x) => x.trim())
|
|
149
149
|
pureValue = GeneratePureValue(value)
|
|
150
|
-
if (pureValue !==
|
|
150
|
+
if (pureValue !== undefined) {
|
|
151
151
|
andQuery.push({ [key]: { $lte: pureValue } })
|
|
152
152
|
}
|
|
153
153
|
break
|
|
154
154
|
case termUpToQuote.includes('>'):
|
|
155
155
|
;[key, value] = SplitFirst(term, '>').map((x) => x.trim())
|
|
156
156
|
pureValue = GeneratePureValue(value)
|
|
157
|
-
if (pureValue !==
|
|
157
|
+
if (pureValue !== undefined) {
|
|
158
158
|
andQuery.push({ [key]: { $gt: pureValue } })
|
|
159
159
|
}
|
|
160
160
|
break
|
|
161
161
|
case termUpToQuote.includes('<'):
|
|
162
162
|
;[key, value] = SplitFirst(term, '<').map((x) => x.trim())
|
|
163
163
|
pureValue = GeneratePureValue(value)
|
|
164
|
-
if (pureValue !==
|
|
164
|
+
if (pureValue !== undefined) {
|
|
165
165
|
andQuery.push({ [key]: { $lt: pureValue } })
|
|
166
166
|
}
|
|
167
167
|
break
|
|
168
168
|
case termUpToQuote.includes('!='):
|
|
169
169
|
;[key, value] = SplitFirst(term, '!=').map((x) => x.trim())
|
|
170
170
|
pureValue = GeneratePureValue(value)
|
|
171
|
-
if (pureValue !==
|
|
171
|
+
if (pureValue !== undefined) {
|
|
172
172
|
andQuery.push({ [key]: { $ne: pureValue } })
|
|
173
173
|
}
|
|
174
174
|
break
|
|
175
175
|
case termUpToQuote.includes('='):
|
|
176
176
|
;[key, value] = SplitFirst(term, '=').map((x) => x.trim())
|
|
177
177
|
pureValue = GeneratePureValue(value)
|
|
178
|
-
if (pureValue !==
|
|
178
|
+
if (pureValue !== undefined) {
|
|
179
179
|
andQuery.push({ [key]: pureValue })
|
|
180
180
|
}
|
|
181
181
|
break
|
|
@@ -200,7 +200,7 @@ export const parseSmartQuery = (
|
|
|
200
200
|
.filter((x) => x)
|
|
201
201
|
|
|
202
202
|
pureValue = GeneratePureValue(queryValue)
|
|
203
|
-
if (pureValue !==
|
|
203
|
+
if (pureValue !== undefined && Array.isArray(pureValue)) {
|
|
204
204
|
andQuery.push({ [key]: { $nin: pureValue } })
|
|
205
205
|
}
|
|
206
206
|
} else {
|
|
@@ -211,7 +211,7 @@ export const parseSmartQuery = (
|
|
|
211
211
|
.filter((x) => x)
|
|
212
212
|
|
|
213
213
|
pureValue = GeneratePureValue(queryValue)
|
|
214
|
-
if (pureValue !==
|
|
214
|
+
if (pureValue !== undefined && Array.isArray(pureValue)) {
|
|
215
215
|
andQuery.push({ [key]: { $in: pureValue } })
|
|
216
216
|
}
|
|
217
217
|
}
|