Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore(instrumentation-fetch): fix lint warnings
  • Loading branch information
alisabzevari committed Sep 3, 2021
commit 07e06c5958cadc63c3a0335736d6328efaee3d30
14 changes: 6 additions & 8 deletions packages/opentelemetry-instrumentation-fetch/src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class FetchInstrumentation extends InstrumentationBase<
);
}

init() {}
init(): void {}

private _getConfig(): FetchInstrumentationConfig {
return this._config;
Expand Down Expand Up @@ -326,11 +326,9 @@ export class FetchInstrumentation extends InstrumentationBase<
}
function onSuccess(
span: api.Span,
resolve: (
value?: Response | PromiseLike<Response> | undefined
) => void,
resolve: (value: Response | PromiseLike<Response>) => void,
response: Response
) {
): void {
try {
const resClone = response.clone();
const body = resClone.body;
Expand Down Expand Up @@ -381,7 +379,7 @@ export class FetchInstrumentation extends InstrumentationBase<
return original
.apply(this, options instanceof Request ? [options] : [url, options])
.then(
(onSuccess as any).bind(this, createdSpan, resolve),
onSuccess.bind(this, createdSpan, resolve),
onError.bind(this, createdSpan, reject)
);
}
Expand Down Expand Up @@ -447,7 +445,7 @@ export class FetchInstrumentation extends InstrumentationBase<
/**
* implements enable function
*/
override enable() {
override enable(): void {
if (isWrapped(window.fetch)) {
this._unwrap(window, 'fetch');
this._diag.debug('removing previous patch for constructor');
Expand All @@ -458,7 +456,7 @@ export class FetchInstrumentation extends InstrumentationBase<
/**
* implements unpatch function
*/
override disable() {
override disable(): void {
this._unwrap(window, 'fetch');
this._usedResources = new WeakSet<PerformanceResourceTiming>();
}
Expand Down