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

Add option to mark current file as entrypoint #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Davilarek
Copy link
Member

Which by default makes the file not to be considered as needed for format conversion which is only useful in entrypoints

which by default makes the file not to be considered as needed for format conversion which is only useful in entrypoints
@Davilarek Davilarek requested a review from JustOptimize July 24, 2024 22:47
@@ -183,7 +183,7 @@ export default async function (ast: ParseResult<File>, targetedDiscordModApiLibr
}
}
parsedBodyWithoutOurImports.unshift(...await addCode(targetedDiscordModApiLibrary.default));
if ((targetedDiscordModApiLibrary as { default: IModImplementation } & { convertFormat: (ast_: Statement[]) => Statement[] }).convertFormat == undefined)
if (shouldConvertFormat == false || (targetedDiscordModApiLibrary as { default: IModImplementation } & { convertFormat: (ast_: Statement[]) => Statement[] }).convertFormat == undefined)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, could you use !shouldConvertFormat ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if it is a string?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

networking taught me to never trust the user

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldConvertFormat is a boolean. What "string" are you referencing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what if somehow user passes a string to that function

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!!

@Davilarek Davilarek marked this pull request as draft July 24, 2024 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants