@sumaris-net/ngx-components 0.27.22 → 0.27.23

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.
@@ -731,6 +731,60 @@
731
731
  return res;
732
732
  }, {});
733
733
  }
734
+ /**
735
+ * Determines if two objects or two values are equivalent.
736
+ *
737
+ * Two objects or values are considered equivalent if at least one of the following is true:
738
+ *
739
+ * * Both objects or values pass `===` comparison.
740
+ * * Both objects or values are of the same type and all of their properties are equal by
741
+ * comparing them with `equals`.
742
+ *
743
+ * @param o1 Object or value to compare.
744
+ * @param o2 Object or value to compare.
745
+ * @returns true if arguments are equal.
746
+ */
747
+ function equals(o1, o2) {
748
+ if (o1 === o2)
749
+ return true;
750
+ if (o1 === null || o2 === null)
751
+ return false;
752
+ if (o1 !== o1 && o2 !== o2)
753
+ return true; // NaN === NaN
754
+ var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
755
+ if (t1 == t2 && t1 == 'object') {
756
+ if (Array.isArray(o1)) {
757
+ if (!Array.isArray(o2))
758
+ return false;
759
+ if ((length = o1.length) == o2.length) {
760
+ for (key = 0; key < length; key++) {
761
+ if (!equals(o1[key], o2[key]))
762
+ return false;
763
+ }
764
+ return true;
765
+ }
766
+ }
767
+ else {
768
+ if (Array.isArray(o2)) {
769
+ return false;
770
+ }
771
+ keySet = Object.create(null);
772
+ for (key in o1) {
773
+ if (!equals(o1[key], o2[key])) {
774
+ return false;
775
+ }
776
+ keySet[key] = true;
777
+ }
778
+ for (key in o2) {
779
+ if (!(key in keySet) && typeof o2[key] !== 'undefined') {
780
+ return false;
781
+ }
782
+ }
783
+ return true;
784
+ }
785
+ }
786
+ return false;
787
+ }
734
788
  var Beans = /** @class */ (function () {
735
789
  function Beans() {
736
790
  }
@@ -2797,8 +2851,6 @@
2797
2851
  function TranslateContextService(translate) {
2798
2852
  this.translate = translate;
2799
2853
  }
2800
- TranslateContextService.prototype.getParsedResult = function (translations, key, interpolateParams) {
2801
- };
2802
2854
  TranslateContextService.prototype.get = function (key, context, interpolateParams) {
2803
2855
  var _this = this;
2804
2856
  // No context: do a normal translate
@@ -2865,11 +2917,12 @@
2865
2917
  if (!query || !query.length) {
2866
2918
  return query;
2867
2919
  }
2868
- var suffix = (params === null || params === void 0 ? void 0 : params.length) > 1 ? params.shift() : '';
2920
+ var suffix = params && params.length ? params[0] : '';
2921
+ params = suffix && params.slice(1);
2869
2922
  // if we ask another time for the same key, return the last value
2870
- if (util.equals(query, this.lastKey)
2871
- && util.equals(suffix, this.lastSuffix)
2872
- && util.equals(params, this.lastParams)) {
2923
+ if (equalsOrNil(query, this.lastKey)
2924
+ && equals(suffix, this.lastSuffix)
2925
+ && equals(params, this.lastParams)) {
2873
2926
  return this.value;
2874
2927
  }
2875
2928
  // store the query, in case it changes
@@ -28289,6 +28342,7 @@
28289
28342
  exports.disableControls = disableControls;
28290
28343
  exports.emitPromiseEvent = emitPromiseEvent;
28291
28344
  exports.entityToString = entityToString;
28345
+ exports.equals = equals;
28292
28346
  exports.equalsOrNil = equalsOrNil;
28293
28347
  exports.fadeInAnimation = fadeInAnimation;
28294
28348
  exports.fadeInOutAnimation = fadeInOutAnimation;