query-core 0.1.15 → 0.1.16

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/lib/query.js CHANGED
@@ -166,6 +166,10 @@ function buildQuery(filter, bparam, table, attrs, sort, fields, sq, strExcluding
166
166
  filters.push(field + " <= " + param(i++));
167
167
  args.push(v['max']);
168
168
  }
169
+ else if (v['top']) {
170
+ filters.push(field + " < " + param(i++));
171
+ args.push(v['top']);
172
+ }
169
173
  else if (v['endDate']) {
170
174
  filters.push(field + " <= " + param(i++));
171
175
  args.push(v['endDate']);
@@ -201,6 +205,9 @@ function buildQuery(filter, bparam, table, attrs, sort, fields, sq, strExcluding
201
205
  if (v['max']) {
202
206
  filters.push(field + " <= " + v['max']);
203
207
  }
208
+ else if (v['top']) {
209
+ filters.push(field + " < " + v['top']);
210
+ }
204
211
  else if (v['upper']) {
205
212
  filters.push(field + " < " + v['upper']);
206
213
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "query-core",
3
- "version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "description": "query",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./src/index.ts",
package/src/query.ts CHANGED
@@ -149,6 +149,9 @@ export function buildQuery<S>(filter: S, bparam: LikeType|((i: number ) => strin
149
149
  if (v['max']) {
150
150
  filters.push(`${field} <= ${param(i++)}`);
151
151
  args.push(v['max']);
152
+ } else if (v['top']) {
153
+ filters.push(`${field} < ${param(i++)}`);
154
+ args.push(v['top']);
152
155
  } else if (v['endDate']) {
153
156
  filters.push(`${field} <= ${param(i++)}`);
154
157
  args.push(v['endDate']);
@@ -177,6 +180,8 @@ export function buildQuery<S>(filter: S, bparam: LikeType|((i: number ) => strin
177
180
  if (isNumberRange(v)) {
178
181
  if (v['max']) {
179
182
  filters.push(`${field} <= ${v['max']}`);
183
+ } else if (v['top']) {
184
+ filters.push(`${field} < ${v['top']}`);
180
185
  } else if (v['upper']) {
181
186
  filters.push(`${field} < ${v['upper']}`);
182
187
  }