Skip to content

Commit

Permalink
chore: replace deprecated String.prototype.substr() with substring() (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Nov 27, 2024
1 parent 3bf1284 commit 5ad0aa5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/opentelemetry-core/src/common/time.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function hrTimeDuration(
export function hrTimeToTimeStamp(time: api.HrTime): string {
const precision = NANOSECOND_DIGITS;
const tmp = `${'0'.repeat(precision)}${time[1]}Z`;
const nanoString = tmp.substr(tmp.length - precision - 1);
const nanoString = tmp.substring(tmp.length - precision - 1);
const date = new Date(time[0] * 1000).toISOString();
return date.replace('000Z', nanoString);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/opentelemetry-sdk-trace-base/src/Span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export class Span implements APISpan, ReadableSpan {
if (value.length <= limit) {
return value;
}
return value.substr(0, limit);
return value.substring(0, limit);
}

/**
Expand Down

0 comments on commit 5ad0aa5

Please sign in to comment.