Skip to content

Correct README.md #2

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

Merged
merged 2 commits into from
Jul 29, 2025
Merged

Conversation

rafinutshaw
Copy link
Contributor

The removed lines below are actually allowed in typescript.

// ❌ This is not allowed due to type safety
// const selectedType2: MediaTypes = MediaTypes.Video;

// ❌ This is not allowed due to type safety
// const invalidType: MediaTypes = 'image';

The removed lines below are actually allowed in typescript.

// ❌ This is not allowed due to type safety
// const selectedType2: MediaTypes = MediaTypes.Video;

// ❌ This is not allowed due to type safety
// const invalidType: MediaTypes = 'image';
README.md Outdated
// ✅ Accessing the value
const associatedText: string = MediaTypes.Image;

// ❌ This is not allowed due to type safety
// const invalidType: MediaTypes = 'image';
Copy link
Owner

Choose a reason for hiding this comment

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

This statement is not allowed because Assigning a string like 'image' to a variable of an enum type (MediaTypes) is a type error in TypeScript

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, thank you for correcting me :)

@@ -314,14 +314,9 @@ enum MediaTypes {

const selectedType: MediaTypes = MediaTypes.Image;

// ❌ This is not allowed due to type safety
// const selectedType2: MediaTypes = MediaTypes.Video;
Copy link
Owner

Choose a reason for hiding this comment

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

thank you!

Copy link
Owner

@Devinterview-io Devinterview-io left a comment

Choose a reason for hiding this comment

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

can you please un-remove lines323-324? Thank you for making this better! Much appreciated!

@rafinutshaw
Copy link
Contributor Author

can you please un-remove lines323-324? Thank you for making this better! Much appreciated!

Done!

@rafinutshaw
Copy link
Contributor Author

Kindly merge it if it looks good now @Devinterview-io
thanks! :-)

@Devinterview-io Devinterview-io merged commit 25c65f6 into Devinterview-io:main Jul 29, 2025
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.

2 participants