Skip to content

Commit

Permalink
chore(instrumentation-grpc): remove unused findIndex() function (#5372
Browse files Browse the repository at this point in the history
)

Co-authored-by: Marc Pichler <[email protected]>
  • Loading branch information
cjihrig and pichlermarc authored Jan 27, 2025
1 parent 2a26d08 commit bdc0e3a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ All notable changes to experimental packages in this project will be documented

### :house: (Internal)

* chore(instrumentation-grpc): remove unused findIndex() function [#5372](https://github.com/open-telemetry/opentelemetry-js/pull/5372) @cjihrig
* refactor(otlp-exporter-base): remove unnecessary isNaN() checks [#5374](https://github.com/open-telemetry/opentelemetry-js/pull/5374) @cjihrig

## 0.57.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,6 @@ import type { IgnoreMatcher } from './types';
export const URI_REGEX =
/(?:([A-Za-z0-9+.-]+):(?:\/\/)?)?(?<name>[A-Za-z0-9+.-]+):(?<port>[0-9+.-]+)$/;

// Equivalent to lodash _.findIndex
export const findIndex: <T>(args: T[], fn: (arg: T) => boolean) => number = (
args,
fn
) => {
let index = -1;
for (const arg of args) {
index++;
if (fn(arg)) {
return index;
}
}
return -1;
};

/**
* Convert a grpc status code to an opentelemetry SpanStatus code.
* @param status
Expand Down

0 comments on commit bdc0e3a

Please sign in to comment.