Skip to content

Commit

Permalink
fix: fix lodash reexport
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Apr 1, 2022
1 parent 3972546 commit b17c435
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/ts/base/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
mapValues,
toArray,
pickBy,
} = lodash
} = (lodash as any).default || lodash

export {
extend,
Expand Down
10 changes: 5 additions & 5 deletions src/main/ts/indicator/abstract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -150,15 +150,15 @@ 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 {
if (deps === undefined || deps === null || isEmpty(deps)) {
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)
}
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit b17c435

Please sign in to comment.