-
Notifications
You must be signed in to change notification settings - Fork 620
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
BREAKING(front_matter): deprecate Format enum, use union type instead #3641
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Makes a lot of sense.
MAP_FORMAT_TO_EXTRACTOR_RX, | ||
MAP_FORMAT_TO_RECOGNIZER_RX, | ||
} from "./_formats.ts"; | ||
|
||
type Format = "yaml" | "toml" | "json" | "unknown"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be exported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, I would think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name 'Format' is currently exported as enum value, which this PR deprecates. I think exporting this 'Format' in this PR could break typing of the user's code.
How about using literal type ("yaml" | "toml" | "json" | "unknown"
) directly in public interfaces?
part of #3601 #3489
This PR deprecates
Format
enum, and use the union type"yaml" | "toml" | "json" | "unknown"
instead forformat
parameters.