chore: replace deprecated String.prototype.substr() with substring() (#5209)
This commit is contained in:
parent
3bf12847d1
commit
5ad0aa544b
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue