@dwtechs/antity-pgsql 0.15.0 → 0.15.1
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/dist/antity-pgsql.js +11 -0
- package/package.json +1 -1
package/dist/antity-pgsql.js
CHANGED
|
@@ -166,6 +166,15 @@ function formatValue(value, matchMode) {
|
|
|
166
166
|
return value;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
+
function shouldSkipValue(value, matchMode) {
|
|
170
|
+
if (isString(value, "0"))
|
|
171
|
+
return true;
|
|
172
|
+
if (isArray(value, "0"))
|
|
173
|
+
return true;
|
|
174
|
+
if (value === null && matchMode !== 'is' && matchMode !== 'isNot')
|
|
175
|
+
return true;
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
169
178
|
function add(filters) {
|
|
170
179
|
var _a, _b;
|
|
171
180
|
const conditions = [];
|
|
@@ -178,6 +187,8 @@ function add(filters) {
|
|
|
178
187
|
const groupConditions = [];
|
|
179
188
|
for (const filter of filterArray) {
|
|
180
189
|
const { value, matchMode } = filter;
|
|
190
|
+
if (shouldSkipValue(value, matchMode))
|
|
191
|
+
continue;
|
|
181
192
|
const indexes = isArray(value) ? value.map(() => i++) : [i++];
|
|
182
193
|
const cond = addOne(k, indexes, matchMode);
|
|
183
194
|
if (cond) {
|