@bbn/bbn 1.0.375 → 1.0.376

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.
@@ -136,12 +136,26 @@ export default function search(arr, prop, val, operator, startFrom, backward) {
136
136
  filter = prop;
137
137
  }
138
138
  else if (isObject(prop)) {
139
- if (!('conditions' in prop)) {
139
+ if ('field' in prop && 'value' in prop) {
140
140
  filter = {
141
141
  conditions: [prop],
142
142
  logic: 'AND'
143
143
  };
144
144
  }
145
+ else if (!('conditions' in prop)) {
146
+ var conditions = [];
147
+ for (var p in prop) {
148
+ conditions.push({
149
+ field: p,
150
+ value: prop[p],
151
+ operator: '='
152
+ });
153
+ }
154
+ filter = {
155
+ conditions: conditions,
156
+ logic: 'AND'
157
+ };
158
+ }
145
159
  else {
146
160
  filter = prop;
147
161
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbn/bbn",
3
- "version": "1.0.375",
3
+ "version": "1.0.376",
4
4
  "description": "Javascript toolkit",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",