@medmain/core
Advanced tools
Comparing version 0.1.26 to 0.1.27
@@ -13,3 +13,12 @@ import get from 'lodash/get'; | ||
this._expressions = expressions; | ||
this._expressions = expressions.map(function (_ref) { | ||
var field = _ref.field, | ||
operator = _ref.operator, | ||
value = _ref.value; | ||
return { | ||
field: field, | ||
operator: operator, | ||
value: value | ||
}; | ||
}); | ||
} | ||
@@ -26,17 +35,17 @@ | ||
for (var _iterator = json, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { | ||
var _ref; | ||
var _ref2; | ||
if (_isArray) { | ||
if (_i >= _iterator.length) break; | ||
_ref = _iterator[_i++]; | ||
_ref2 = _iterator[_i++]; | ||
} else { | ||
_i = _iterator.next(); | ||
if (_i.done) break; | ||
_ref = _i.value; | ||
_ref2 = _i.value; | ||
} | ||
var _ref2 = _ref, | ||
field = _ref2.field, | ||
operator = _ref2.operator, | ||
value = _ref2.value; | ||
var _ref3 = _ref2, | ||
field = _ref3.field, | ||
operator = _ref3.operator, | ||
value = _ref3.value; | ||
var fieldSchema = this.getFieldSchema(field); | ||
@@ -75,14 +84,14 @@ | ||
for (var _iterator2 = fields, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { | ||
var _ref3; | ||
var _ref4; | ||
if (_isArray2) { | ||
if (_i2 >= _iterator2.length) break; | ||
_ref3 = _iterator2[_i2++]; | ||
_ref4 = _iterator2[_i2++]; | ||
} else { | ||
_i2 = _iterator2.next(); | ||
if (_i2.done) break; | ||
_ref3 = _i2.value; | ||
_ref4 = _i2.value; | ||
} | ||
var field = _ref3; | ||
var field = _ref4; | ||
var value = get(json, field); | ||
@@ -128,6 +137,6 @@ normalizedJSON.push({ | ||
_proto._getCleanExpressions = function _getCleanExpressions() { | ||
return this._expressions.filter(function (_ref4) { | ||
var field = _ref4.field, | ||
operator = _ref4.operator, | ||
value = _ref4.value; | ||
return this._expressions.filter(function (_ref5) { | ||
var field = _ref5.field, | ||
operator = _ref5.operator, | ||
value = _ref5.value; | ||
@@ -154,5 +163,5 @@ if (!field) { | ||
_proto.setExpression = function setExpression(field, _ref5) { | ||
var operator = _ref5.operator, | ||
value = _ref5.value; | ||
_proto.setExpression = function setExpression(field, _ref6) { | ||
var operator = _ref6.operator, | ||
value = _ref6.value; | ||
var fieldSchema = this.constructor.getFieldSchema(field); | ||
@@ -204,17 +213,17 @@ | ||
for (var _iterator3 = this._expressions, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { | ||
var _ref6; | ||
var _ref7; | ||
if (_isArray3) { | ||
if (_i3 >= _iterator3.length) break; | ||
_ref6 = _iterator3[_i3++]; | ||
_ref7 = _iterator3[_i3++]; | ||
} else { | ||
_i3 = _iterator3.next(); | ||
if (_i3.done) break; | ||
_ref6 = _i3.value; | ||
_ref7 = _i3.value; | ||
} | ||
var _ref7 = _ref6, | ||
field = _ref7.field, | ||
operator = _ref7.operator, | ||
value = _ref7.value; | ||
var _ref8 = _ref7, | ||
field = _ref8.field, | ||
operator = _ref8.operator, | ||
value = _ref8.value; | ||
field = kebabCase(field); | ||
@@ -221,0 +230,0 @@ |
@@ -18,3 +18,11 @@ "use strict"; | ||
constructor(expressions = []) { | ||
this._expressions = expressions; | ||
this._expressions = expressions.map(({ | ||
field, | ||
operator, | ||
value | ||
}) => ({ | ||
field, | ||
operator, | ||
value | ||
})); | ||
} | ||
@@ -21,0 +29,0 @@ |
@@ -7,3 +7,11 @@ import get from 'lodash/get'; | ||
constructor(expressions = []) { | ||
this._expressions = expressions; | ||
this._expressions = expressions.map(({ | ||
field, | ||
operator, | ||
value | ||
}) => ({ | ||
field, | ||
operator, | ||
value | ||
})); | ||
} | ||
@@ -10,0 +18,0 @@ |
{ | ||
"name": "@medmain/core", | ||
"version": "0.1.26", | ||
"version": "0.1.27", | ||
"description": "Medmain's core module, root of everything else", | ||
@@ -5,0 +5,0 @@ "files": [ |
67306
7
2193