From bdc0e3a34c50826f4393c43a48b268e68da6f7c4 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Mon, 27 Jan 2025 04:44:10 -0500 Subject: [PATCH] chore(instrumentation-grpc): remove unused `findIndex()` function (#5372) Co-authored-by: Marc Pichler --- experimental/CHANGELOG.md | 1 + .../src/utils.ts | 15 --------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index c1762a1da63..e7126be0f78 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -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 diff --git a/experimental/packages/opentelemetry-instrumentation-grpc/src/utils.ts b/experimental/packages/opentelemetry-instrumentation-grpc/src/utils.ts index 3cfbfc1f55d..002a2da3355 100644 --- a/experimental/packages/opentelemetry-instrumentation-grpc/src/utils.ts +++ b/experimental/packages/opentelemetry-instrumentation-grpc/src/utils.ts @@ -23,21 +23,6 @@ import type { IgnoreMatcher } from './types'; export const URI_REGEX = /(?:([A-Za-z0-9+.-]+):(?:\/\/)?)?(?[A-Za-z0-9+.-]+):(?[0-9+.-]+)$/; -// Equivalent to lodash _.findIndex -export const findIndex: (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