@trudb/tru-common-lib 0.0.259 → 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.
@@ -790,38 +790,40 @@ class TruQueryPredicateManager {
790
790
  this._propertyQueryPath = null;
791
791
  this._predicateName = '';
792
792
  this._predicateMap = {};
793
+ this.setPredicate = (queryPredicate) => {
794
+ if (this._predicate !== queryPredicate && this._predicateMap !== null) {
795
+ this._predicate = queryPredicate;
796
+ this._predicateMap[this._predicateName] = this._predicate === null ? null : this._predicate;
797
+ }
798
+ };
793
799
  /**
794
- * Returns a new query predicate.
795
- *
796
- * @param {string} field - Name of the storage field relative to the intent property.
797
- * @param {string} operator - Name of the predicate operator.
798
- * @param {*} value - Literal value.
800
+ * Returns the query predicate.
799
801
  */
800
- this.create = (field, operator, value, overQuoted) => {
801
- return new TruPredicate(field, operator, value, this._propertyQueryPath, overQuoted)._breezePredicate;
802
+ this.get = () => {
803
+ return this._predicate;
802
804
  };
803
805
  /**
804
- * Clears the query predicate.
805
- */
806
+ * Clears the query predicate.
807
+ */
806
808
  this.clear = () => {
807
809
  this.setPredicate(null);
808
810
  };
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
+ //}
809
817
  /**
810
- * Returns the query predicate.
811
- */
812
- this.get = () => {
813
- return this._predicate;
818
+ * Returns a new query predicate.
819
+ *
820
+ * @param {string} field - Name of the storage field relative to the intent property.
821
+ * @param {string} operator - Name of the predicate operator.
822
+ * @param {*} value - Literal value.
823
+ */
824
+ this.create = (field, operator, value, overQuoted) => {
825
+ return new TruPredicate(field, operator, value, this._propertyQueryPath, overQuoted)._breezePredicate;
814
826
  };
815
- /**
816
- * Sets the query predicate.
817
- *
818
- * @param {Predicate} predicate - A predicate object -- from create().
819
- * OR
820
- * @param {string} field - Name of the storage field relative to the intent property.
821
- * @param {string} operator - Name of the predicate operator.
822
- * @param {*} value - Literal value.
823
- */
824
- //REMOVE AFTER TESTING!!!!
825
827
  this.set = (fieldOrPredicate, operator, value, overQuoted = false) => {
826
828
  var predicate;
827
829
  if (fieldOrPredicate.constructor === TruPredicate)
@@ -830,16 +832,6 @@ class TruQueryPredicateManager {
830
832
  predicate = this.create(fieldOrPredicate, operator, value, overQuoted);
831
833
  this.setPredicate(predicate);
832
834
  };
833
- this.setPredicate = (queryPredicate) => {
834
- if (this._predicate !== queryPredicate && this._predicateMap !== null) {
835
- this._predicate = queryPredicate;
836
- this._predicateMap[this._predicateName] = this._predicate === null ? null : this._predicate;
837
- }
838
- };
839
- this.createPredicate = (fieldOrPredicate, operator, value, overQuoted = false) => {
840
- let predicate = this.create(fieldOrPredicate, operator, value, overQuoted);
841
- this.setPredicate(predicate);
842
- };
843
835
  this._propertyQueryPath = propertyQueryPath;
844
836
  this._predicateName = predicateName;
845
837
  this._predicateMap = predicateMap;