Skip to content

Commit

Permalink
refactor(resources): fix eslint warning
Browse files Browse the repository at this point in the history
```
/home/runner/work/opentelemetry-js/opentelemetry-js/packages/opentelemetry-resources/src/utils.ts
  17:39  warning  Unexpected any. Specify a different type  @typescript-eslint/no-explicit-any
```

Ref open-telemetry#5365
  • Loading branch information
chancancode committed Jan 27, 2025
1 parent 199fd8d commit b226519
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/opentelemetry-resources/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
* limitations under the License.
*/

export const isPromiseLike = <R>(val: any): val is PromiseLike<R> => {
export const isPromiseLike = <R>(val: unknown): val is PromiseLike<R> => {
return (
val !== null && typeof val === 'object' && typeof val.then === 'function'
val !== null &&
typeof val === 'object' &&
typeof (val as Partial<PromiseLike<R>>).then === 'function'
);
};

0 comments on commit b226519

Please sign in to comment.