@trudb/tru-common-lib 0.0.259 → 0.0.260
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/esm2020/lib/classes/tru-query-predicate-manager.mjs +20 -36
- package/fesm2015/trudb-tru-common-lib.mjs +19 -35
- package/fesm2015/trudb-tru-common-lib.mjs.map +1 -1
- package/fesm2020/trudb-tru-common-lib.mjs +19 -35
- package/fesm2020/trudb-tru-common-lib.mjs.map +1 -1
- package/lib/classes/tru-query-predicate-manager.d.ts +13 -23
- package/package.json +1 -1
|
@@ -790,21 +790,11 @@ class TruQueryPredicateManager {
|
|
|
790
790
|
this._propertyQueryPath = null;
|
|
791
791
|
this._predicateName = '';
|
|
792
792
|
this._predicateMap = {};
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
* @param {*} value - Literal value.
|
|
799
|
-
*/
|
|
800
|
-
this.create = (field, operator, value, overQuoted) => {
|
|
801
|
-
return new TruPredicate(field, operator, value, this._propertyQueryPath, overQuoted)._breezePredicate;
|
|
802
|
-
};
|
|
803
|
-
/**
|
|
804
|
-
* Clears the query predicate.
|
|
805
|
-
*/
|
|
806
|
-
this.clear = () => {
|
|
807
|
-
this.setPredicate(null);
|
|
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
|
+
}
|
|
808
798
|
};
|
|
809
799
|
/**
|
|
810
800
|
* Returns the query predicate.
|
|
@@ -813,32 +803,26 @@ class TruQueryPredicateManager {
|
|
|
813
803
|
return this._predicate;
|
|
814
804
|
};
|
|
815
805
|
/**
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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
|
-
//REMOVE AFTER TESTING!!!!
|
|
825
|
-
this.set = (fieldOrPredicate, operator, value, overQuoted = false) => {
|
|
826
|
-
var predicate;
|
|
827
|
-
if (fieldOrPredicate.constructor === TruPredicate)
|
|
828
|
-
predicate = fieldOrPredicate;
|
|
829
|
-
else
|
|
830
|
-
predicate = this.create(fieldOrPredicate, operator, value, overQuoted);
|
|
831
|
-
this.setPredicate(predicate);
|
|
806
|
+
* Clears the query predicate.
|
|
807
|
+
*/
|
|
808
|
+
this.clear = () => {
|
|
809
|
+
this.setPredicate(null);
|
|
832
810
|
};
|
|
833
|
-
this.
|
|
811
|
+
this.set = (queryPredicate) => {
|
|
834
812
|
if (this._predicate !== queryPredicate && this._predicateMap !== null) {
|
|
835
813
|
this._predicate = queryPredicate;
|
|
836
814
|
this._predicateMap[this._predicateName] = this._predicate === null ? null : this._predicate;
|
|
837
815
|
}
|
|
838
816
|
};
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
817
|
+
/**
|
|
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;
|
|
842
826
|
};
|
|
843
827
|
this._propertyQueryPath = propertyQueryPath;
|
|
844
828
|
this._predicateName = predicateName;
|