Skip to content

Commit 446df47

Browse files
committed
refactor(sdk-metrics): fix eslint warning
``` /home/runner/work/opentelemetry-js/opentelemetry-js/packages/sdk-metrics/src/state/DeltaMetricProcessor.ts 96:32 warning Forbidden non-null assertion @typescript-eslint/no-non-null-assertion ``` The assertion was intentional, base on the `.has()` check with the same inputs immediately prior. The surrounding code has the same patterns and used the eslint magic comment to disable the warning, this one was just missed. Ref open-telemetry#5365
1 parent 199fd8d commit 446df47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/sdk-metrics/src/state/DeltaMetricProcessor.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ export class DeltaMetricProcessor<T extends Maybe<Accumulation>> {
9393
attributes = this._overflowAttributes;
9494
hashCode = this._overflowHashCode;
9595
if (this._cumulativeMemoStorage.has(attributes, hashCode)) {
96+
// has() returned true, previous is present.
97+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
9698
const previous = this._cumulativeMemoStorage.get(
9799
attributes,
98100
hashCode
@@ -103,7 +105,7 @@ export class DeltaMetricProcessor<T extends Maybe<Accumulation>> {
103105
}
104106
// Merge with uncollected active delta.
105107
if (this._activeCollectionStorage.has(attributes, hashCode)) {
106-
// has() returned true, previous is present.
108+
// has() returned true, active is present.
107109
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
108110
const active = this._activeCollectionStorage.get(
109111
attributes,

0 commit comments

Comments
 (0)