chore: replace deprecated String.prototype.substr() with substring() (#5209)

This commit is contained in:
Trivikram Kamat 2024-11-27 08:10:35 -08:00 committed by GitHub
parent 3bf12847d1
commit 5ad0aa544b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}

View File

@ -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);
}
/**