Skip to content

Commit

Permalink
chore(aws): replace deprecated substr with substring (#2551)
Browse files Browse the repository at this point in the history
  • Loading branch information
trivikr authored Nov 26, 2024
1 parent d5215f3 commit 468222b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,10 @@ export class AwsLambdaInstrumentation extends InstrumentationBase<AwsLambdaInstr
}

const handler = path.basename(handlerDef);
const moduleRoot = handlerDef.substr(0, handlerDef.length - handler.length);
const moduleRoot = handlerDef.substring(
0,
handlerDef.length - handler.length
);

const [module, functionName] = handler.split('.', 2);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class SnsServiceExtension implements ServiceExtension {
if (topicArn || targetArn) {
const arn = topicArn ?? targetArn;
try {
return arn.substr(arn.lastIndexOf(':') + 1);
return arn.substring(arn.lastIndexOf(':') + 1);
} catch (err) {
return arn;
}
Expand Down

0 comments on commit 468222b

Please sign in to comment.