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

feat: move text encoding functionality into deno_graph::source from CLI #370

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

dsherret
Copy link
Member

Moving this into the CLI allows me to delete some CLI code and re-use the functionality that's already in this crate.

return MediaType::Unknown;
};
MediaType::from_content_type(
&ModuleSpecifier::parse("data:image/png;base64,").unwrap(),
Copy link
Member

Choose a reason for hiding this comment

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

Is this just to satisfy the type system? Can there be a situation where this will return wrong value? (I guess it will return Unknown if content_type is not recognized)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yeah I'll add a comment, todo, and open an issue in media_type to improve this. Yeah, it just gets ignored.

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually, I'll just add a comment here. This is extremely edge casey and in 99% of cases someone should be providing a specifier to this.

@dsherret dsherret merged commit 3a27ae5 into denoland:main Feb 1, 2024
4 checks passed
@dsherret dsherret deleted the feat_source_functionality branch February 1, 2024 00:01
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.

None yet

2 participants