@dereekb/dbx-core 13.15.0 → 13.16.0

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.
@@ -733,16 +733,16 @@ class DbxActionAutoTriggerDirective {
733
733
  */
734
734
  triggerCount$ = toObservable(this.triggerEnabled).pipe(switchMap((enabled) => {
735
735
  let countObs;
736
- if (enabled !== false) {
737
- countObs = this._triggerCount$;
736
+ if (enabled === false) {
737
+ countObs = EMPTY;
738
738
  }
739
739
  else {
740
- countObs = EMPTY;
740
+ countObs = this._triggerCount$;
741
741
  }
742
742
  return countObs;
743
743
  }));
744
744
  _isTriggerLimited$ = combineLatest([this.triggerCount$, toObservable(this.triggerLimit)]).pipe(map(([triggerCount, limit]) => {
745
- const isAllowedToRun = limit != null ? triggerCount < limit : true;
745
+ const isAllowedToRun = limit == null ? true : triggerCount < limit;
746
746
  return [triggerCount, isAllowedToRun];
747
747
  }), shareReplay(1));
748
748
  isTriggerAllowedToRun$ = this._isTriggerLimited$.pipe(map((x) => x[1]), shareReplay(1));
@@ -1557,14 +1557,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
1557
1557
  * ```typescript
1558
1558
  */
1559
1559
  function provideActionStoreSource(sourceType) {
1560
- const storeSourceProvider = sourceType != null
1560
+ const storeSourceProvider = sourceType == null
1561
1561
  ? {
1562
1562
  provide: ActionContextStoreSource,
1563
- useExisting: forwardRef(() => sourceType)
1563
+ useFactory: () => new DbxActionContextMachineAsService()
1564
1564
  }
1565
1565
  : {
1566
1566
  provide: ActionContextStoreSource,
1567
- useFactory: () => new DbxActionContextMachineAsService()
1567
+ useExisting: forwardRef(() => sourceType)
1568
1568
  };
1569
1569
  return [
1570
1570
  storeSourceProvider,
@@ -2868,11 +2868,11 @@ class DbxActionValueGetterInstance {
2868
2868
  // Catch unknown errors and pass them to reject.
2869
2869
  catchError((reject) => of({ reject: toReadableError(reject) })))))
2870
2870
  .subscribe((result) => {
2871
- if (result.value != null) {
2872
- this.source.readyValue(result.value);
2871
+ if (result.value == null) {
2872
+ this.source.reject(result.reject);
2873
2873
  }
2874
2874
  else {
2875
- this.source.reject(result.reject);
2875
+ this.source.readyValue(result.value);
2876
2876
  }
2877
2877
  });
2878
2878
  }
@@ -6244,14 +6244,14 @@ class DbxRouteParamDefaultRedirectInstance {
6244
6244
  }
6245
6245
  redirectWithDefaultValue(value) {
6246
6246
  let result;
6247
- if (value != null) {
6248
- // perform a segue once
6249
- result = this.redirectWithValue(value);
6250
- }
6251
- else {
6247
+ if (value == null) {
6252
6248
  // do nothing
6253
6249
  result = Promise.resolve(false);
6254
6250
  }
6251
+ else {
6252
+ // perform a segue once
6253
+ result = this.redirectWithValue(value);
6254
+ }
6255
6255
  return result;
6256
6256
  }
6257
6257
  redirectWithValue(value) {
@@ -6769,14 +6769,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
6769
6769
  class DateDistancePipe {
6770
6770
  transform(input, inputTo, unavailable = 'Not Available') {
6771
6771
  let result;
6772
- if (input != null) {
6772
+ if (input == null) {
6773
+ result = unavailable;
6774
+ }
6775
+ else {
6773
6776
  const to = inputTo ?? new Date();
6774
6777
  const from = ToJsDatePipe.toJsDate(input);
6775
6778
  result = formatDateDistance(to, from);
6776
6779
  }
6777
- else {
6778
- result = unavailable;
6779
- }
6780
6780
  return result;
6781
6781
  }
6782
6782
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DateDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
@@ -6971,7 +6971,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
6971
6971
  */
6972
6972
  class DateRangeDistancePipe {
6973
6973
  transform(input, unavailable = 'Not Available') {
6974
- return input != null ? formatDateDistance(input, new Date()) : unavailable;
6974
+ return input == null ? unavailable : formatDateDistance(input, new Date());
6975
6975
  }
6976
6976
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: DateRangeDistancePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
6977
6977
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: DateRangeDistancePipe, isStandalone: true, name: "dateRangeDistance", pure: false });
@@ -7191,12 +7191,12 @@ class MinutesStringPipe {
7191
7191
  if (minutes > MINUTES_IN_DAY * 2.5) {
7192
7192
  const unrounded = minutes / MINUTES_IN_DAY;
7193
7193
  const days = Math.ceil(unrounded);
7194
- result = (unrounded !== days ? '~' : '') + days + ' days';
7194
+ result = (unrounded === days ? '' : '~') + days + ' days';
7195
7195
  }
7196
7196
  else if (minutes > MINUTES_IN_HOUR * 3) {
7197
7197
  const unrounded = minutes / MINUTES_IN_HOUR;
7198
7198
  const hours = Math.ceil(unrounded);
7199
- result = (unrounded !== hours ? '~' : '') + hours + ' hours';
7199
+ result = (unrounded === hours ? '' : '~') + hours + ' hours';
7200
7200
  }
7201
7201
  else {
7202
7202
  result = minutes + ' minutes';
@@ -7421,7 +7421,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.11", ngImpo
7421
7421
  */
7422
7422
  class CutTextPipe {
7423
7423
  transform(input, maxLength, endText) {
7424
- return input != null ? cutString(input, maxLength, endText) : input;
7424
+ return input == null ? input : cutString(input, maxLength, endText);
7425
7425
  }
7426
7426
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.11", ngImport: i0, type: CutTextPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
7427
7427
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.11", ngImport: i0, type: CutTextPipe, isStandalone: true, name: "cutText" });
@@ -8904,11 +8904,11 @@ class SimpleStorageAccessor {
8904
8904
  let result;
8905
8905
  if (storedData) {
8906
8906
  const readStoredData = this.readStoredData(storedData);
8907
- if (!readStoredData.expired) {
8908
- result = readStoredData.convertedData;
8907
+ if (readStoredData.expired) {
8908
+ throw new DataIsExpiredError(readStoredData);
8909
8909
  }
8910
8910
  else {
8911
- throw new DataIsExpiredError(readStoredData);
8911
+ result = readStoredData.convertedData;
8912
8912
  }
8913
8913
  }
8914
8914
  else {