semanticdb-core 1.0.36 → 1.0.38
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.
|
@@ -22,21 +22,13 @@ const tws = (0, date_1.getSupportedTimeWindows)();
|
|
|
22
22
|
*/
|
|
23
23
|
const isDimensionInQuery = (query, dimension, strictMode = true) => {
|
|
24
24
|
const flattenQuery = (0, exports.getFlattenQuery)(query);
|
|
25
|
+
// 最简单的
|
|
26
|
+
if (typeof dimension === 'string' && dimension in flattenQuery) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
25
29
|
if (strictMode) {
|
|
26
30
|
if (typeof dimension === 'string') {
|
|
27
|
-
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
// 如果是单纯的$exists: true, 不认为是。
|
|
31
|
-
const v = flattenQuery[dimension];
|
|
32
|
-
if (v &&
|
|
33
|
-
typeof v === 'object' &&
|
|
34
|
-
'$exists' in v &&
|
|
35
|
-
v['$exists'] === true &&
|
|
36
|
-
Object.keys(v).length === 1) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
return true;
|
|
31
|
+
return dimension in flattenQuery;
|
|
40
32
|
}
|
|
41
33
|
else if (dimension._id in flattenQuery) {
|
|
42
34
|
if ((0, date_1.isStandardDateForm)(flattenQuery[dimension._id])) {
|