Merge pull request #127 from IronRookieCoder/fix/yaml-frontmatter-node-polyfill
fix(yaml): guard Bun YAML parser availability
This commit is contained in:
commit
b7153a12a7
|
|
@ -7,7 +7,7 @@
|
|||
*/
|
||||
|
||||
export function parseYaml(input: string): unknown {
|
||||
if (typeof Bun !== 'undefined') {
|
||||
if (typeof Bun !== 'undefined' && Bun.YAML?.parse) {
|
||||
return Bun.YAML.parse(input)
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user