Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Transform AWS.Endpoint instance creation with URL #694

Closed
1 task
trivikr opened this issue Nov 6, 2023 · 3 comments · Fixed by #840
Closed
1 task

[Feature]: Transform AWS.Endpoint instance creation with URL #694

trivikr opened this issue Nov 6, 2023 · 3 comments · Fixed by #840
Labels
enhancement New feature or request

Comments

@trivikr
Copy link
Member

trivikr commented Nov 6, 2023

Self-service

  • I'd be willing to implement this feature

Problem

Codemod does not transform AWS.Endpoint

import AWS from "aws-sdk";

const endpoint = new AWS.Endpoint("http://localhost:8000");

Solution

Transform AWS.Endpoint instance creation with just the string with a comment.

// This endpoint is likely created to be passed to AWS Client.
// If yes, it can be set directly as a string.
const endpoint = "http://localhost:8000";

Alternatives

N/A

Additional context

Refs: #592

@trivikr trivikr added the enhancement New feature or request label Nov 6, 2023
@trivikr
Copy link
Member Author

trivikr commented Apr 11, 2024

The AWS.Endpoint constructor can be safely changed to URL for most common cases.

const endpoint = new URL("http://localhost:8000/");

The URL constructor can fail if protocol is not passed.
But that'll provide ERR_INVALID_URL while testing.

Copy link
Contributor

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant