@trudb/tru-common-lib 0.0.260 → 0.0.261

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.
@@ -808,12 +808,12 @@ class TruQueryPredicateManager {
808
808
  this.clear = () => {
809
809
  this.setPredicate(null);
810
810
  };
811
- this.set = (queryPredicate) => {
812
- if (this._predicate !== queryPredicate && this._predicateMap !== null) {
813
- this._predicate = queryPredicate;
814
- this._predicateMap[this._predicateName] = this._predicate === null ? null : this._predicate;
815
- }
816
- };
811
+ //set = (queryPredicate: TruPredicate) => {
812
+ // if (this._predicate !== queryPredicate && this._predicateMap !== null) {
813
+ // this._predicate = queryPredicate;
814
+ // this._predicateMap[this._predicateName] = this._predicate === null ? null : this._predicate;
815
+ // }
816
+ //}
817
817
  /**
818
818
  * Returns a new query predicate.
819
819
  *
@@ -824,6 +824,14 @@ class TruQueryPredicateManager {
824
824
  this.create = (field, operator, value, overQuoted) => {
825
825
  return new TruPredicate(field, operator, value, this._propertyQueryPath, overQuoted)._breezePredicate;
826
826
  };
827
+ this.set = (fieldOrPredicate, operator, value, overQuoted = false) => {
828
+ var predicate;
829
+ if (fieldOrPredicate.constructor === TruPredicate)
830
+ predicate = fieldOrPredicate;
831
+ else
832
+ predicate = this.create(fieldOrPredicate, operator, value, overQuoted);
833
+ this.setPredicate(predicate);
834
+ };
827
835
  this._propertyQueryPath = propertyQueryPath;
828
836
  this._predicateName = predicateName;
829
837
  this._predicateMap = predicateMap;