-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path@mswjs__data.patch
89 lines (89 loc) · 15.4 KB
/
@mswjs__data.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..c3dfdea14e913ccf30bf4367abac999d7200f40c
--- /dev/null
+++ b/.DS_Store
@@ -0,0 +1 @@
+ Bud1 spblob �bp l i bbwspblob �bplist00�]ShowStatusBar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds[ShowSidebar _{{304, 462}, {920, 436}} #/;R_klmno� � l i bvSrnlong @ � @ � @ � @ E DSDB ` � @ � @ � @
\ No newline at end of file
diff --git a/lib/.DS_Store b/lib/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..0a532e42e3d2506e52e47beac0828107e53ab151
--- /dev/null
+++ b/lib/.DS_Store
@@ -0,0 +1 @@
+ Bud1 � a r a t o r c o m p a r a t o r sdsclbool e r r o r sdsclbool q u e r ydsclbool @ � @ � @ � @ E � DSDB ` @ � @ � @
\ No newline at end of file
diff --git a/lib/query/compileQuery.js b/lib/query/compileQuery.js
index 2bacdfbf3af4ca66c7a7923b5d069d6c55f18f33..65255e9a18fa209b88d2a75d3660f8bd989e81f3 100644
--- a/lib/query/compileQuery.js
+++ b/lib/query/compileQuery.js
@@ -38,16 +38,25 @@ function compileQuery(query) {
if (!queryChunk) {
return true;
}
- // If an entity doesn't have any value for the property
- // is being queried for, treat it as non-matching.
- if (actualValue == null) {
- return false;
- }
return Object.entries(queryChunk).reduce(function (acc, _a) {
var _b = __read(_a, 2), comparatorName = _b[0], expectedValue = _b[1];
if (!acc) {
return acc;
}
+
+ if (comparatorName === "equals" && expectedValue === null) {
+ return actualValue === null
+ }
+
+ if (comparatorName === "notEquals" && expectedValue === null) {
+ return actualValue !== null
+ }
+
+ // If an entity doesn't have any value for the property
+ // is being queried for, treat it as non-matching.
+ if (actualValue == null) {
+ return false
+ }
if (Array.isArray(actualValue)) {
log('actual value is array, checking if at least one item matches...', {
comparatorName: comparatorName,
diff --git a/lib/query/queryTypes.d.ts b/lib/query/queryTypes.d.ts
index c2087caa210765c1d6e40ab4b99d8fcdeb80c700..f89c6de12f13913cdb2f2f6ccc1157a9c2d38583 100644
--- a/lib/query/queryTypes.d.ts
+++ b/lib/query/queryTypes.d.ts
@@ -41,8 +41,8 @@ export declare type QueryToComparator<QueryType extends StringQuery | NumberQuer
};
export declare type GetQueryFor<ValueType extends any> = ValueType extends string ? StringQuery : ValueType extends number ? NumberQuery : ValueType extends Boolean ? BooleanQuery : ValueType extends Date ? DateQuery : ValueType extends Array<infer ItemType> ? QuerySelector<ItemType>['where'] : ValueType extends Value<any, any> ? QuerySelector<ValueType>['where'] : never;
export interface StringQuery {
- equals: string;
- notEquals: string;
+ equals: string | null;
+ notEquals: string | null;
contains: string;
notContains: string;
gt: string;
@@ -53,8 +53,8 @@ export interface StringQuery {
notIn: string[];
}
export interface NumberQuery {
- equals: number;
- notEquals: number;
+ equals: number | null;
+ notEquals: number | null;
between: [number, number];
notBetween: [number, number];
gt: number;
@@ -69,8 +69,8 @@ export interface BooleanQuery {
notEquals: boolean;
}
export interface DateQuery {
- equals: Date;
- notEquals: Date;
+ equals: Date | null;
+ notEquals: Date | null;
gt: Date;
gte: Date;
lt: Date;