From b17c43510e4496024fc49abcdad919873ce6b387 Mon Sep 17 00:00:00 2001 From: Anton Golub Date: Fri, 1 Apr 2022 21:44:00 +0300 Subject: [PATCH] fix: fix lodash reexport --- src/main/ts/base/index.ts | 2 +- src/main/ts/indicator/abstract.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/ts/base/index.ts b/src/main/ts/base/index.ts index 95e213d..8ce8b5d 100644 --- a/src/main/ts/base/index.ts +++ b/src/main/ts/base/index.ts @@ -8,7 +8,7 @@ const { mapValues, toArray, pickBy, -} = lodash +} = (lodash as any).default || lodash export { extend, diff --git a/src/main/ts/indicator/abstract.ts b/src/main/ts/indicator/abstract.ts index fb4cfde..60a6c62 100644 --- a/src/main/ts/indicator/abstract.ts +++ b/src/main/ts/indicator/abstract.ts @@ -59,7 +59,7 @@ export class AbstractIndicator implements IIndicator { health (): IHealth { const status = this.getStatus() const critical = this.getCritical() - const deps: IHealthDeps = mapValues(this.getDeps(), dep => dep.health()) + const deps: IHealthDeps = mapValues(this.getDeps(), (dep: IIndicator) => dep.health()) const extra: any = this.getExtra() return new Health({ @@ -150,7 +150,7 @@ export class AbstractIndicator implements IIndicator { return !!def } - return !!find(deps, dep => dep.health().critical) + return !!find(deps, (dep: IIndicator) => dep.health().critical) } static resolveStatusFromDeps (deps: IIndicatorDeps | undefined, order: string[], def?: string): string { @@ -158,7 +158,7 @@ export class AbstractIndicator implements IIndicator { return '' + def } - const criticalDeps: IIndicatorDeps = pickBy(deps, dep => dep.health().critical) + const criticalDeps: IIndicatorDeps = pickBy(deps, (dep: IIndicator) => dep.health().critical) if (!isEmpty(criticalDeps)) { return this.getLowestStatus(criticalDeps, order) } @@ -175,7 +175,7 @@ export class AbstractIndicator implements IIndicator { const depsArray: IIndicator[] = toArray(deps) const _order = order || this.getSeverityOrder() - return minBy(depsArray, dep => { + return minBy(depsArray, (dep: IIndicator) => { const index = _order.indexOf(dep.health().status) return index === -1 @@ -193,7 +193,7 @@ export class AbstractIndicator implements IIndicator { const depsArray: IIndicator[] = toArray(deps) const _order = order || this.getSeverityOrder() - return maxBy(depsArray, dep => { + return maxBy(depsArray, (dep: IIndicator) => { const index = _order.indexOf(dep.health().status) return index === -1