Skip to content

Commit

Permalink
use the polyfilled startsWith
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitZugmeyer committed Mar 20, 2024
1 parent fa634d6 commit 7398f82
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/tools/instrumentMethod.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { setTimeout } from './timer'
import { callMonitored } from './monitor'
import { noop } from './utils/functionUtils'
import { arrayFrom } from './utils/polyfills'
import { arrayFrom, startsWith } from './utils/polyfills'

/**
* Object passed to the callback of an instrumented method call. See `instrumentMethod` for more
Expand Down Expand Up @@ -58,7 +58,7 @@ export function instrumentMethod<TARGET extends { [key: string]: any }, METHOD e
let original = targetPrototype[method]

if (typeof original !== 'function') {
if (method.startsWith('on')) {
if (startsWith(method, 'on')) {
original = noop as TARGET[METHOD]
} else {
return { stop: noop }
Expand Down

0 comments on commit 7398f82

Please sign in to comment.