mirror of
https://github.com/oven-sh/bun
synced 2026-02-14 04:49:06 +00:00
### What does this PR do?
This PR adds builtin YAML parsing with `Bun.YAML.parse`
```js
import { YAML } from "bun";
const items = YAML.parse("- item1");
console.log(items); // [ "item1" ]
```
Also YAML imports work just like JSON and TOML imports
```js
import pkg from "./package.yaml"
console.log({ pkg }); // { pkg: { name: "pkg", version: "1.1.1" } }
```
### How did you verify your code works?
Added some tests for YAML imports and parsed values.
---------
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
44 lines
1.1 KiB
JSON
44 lines
1.1 KiB
JSON
{
|
|
" != undefined": 0,
|
|
" == undefined": 0,
|
|
"!= alloc.ptr": 0,
|
|
"!= allocator.ptr": 0,
|
|
".arguments_old(": 276,
|
|
".jsBoolean(false)": 0,
|
|
".jsBoolean(true)": 0,
|
|
".stdDir()": 41,
|
|
".stdFile()": 18,
|
|
"// autofix": 168,
|
|
": [^=]+= undefined,$": 260,
|
|
"== alloc.ptr": 0,
|
|
"== allocator.ptr": 0,
|
|
"@import(\"bun\").": 0,
|
|
"EXCEPTION_ASSERT(!scope.exception())": 0,
|
|
"JSValue.false": 0,
|
|
"JSValue.true": 0,
|
|
"alloc.ptr !=": 0,
|
|
"alloc.ptr ==": 0,
|
|
"allocator.ptr !=": 1,
|
|
"allocator.ptr ==": 0,
|
|
"global.hasException": 28,
|
|
"globalObject.hasException": 47,
|
|
"globalThis.hasException": 133,
|
|
"std.StringArrayHashMap(": 1,
|
|
"std.StringArrayHashMapUnmanaged(": 11,
|
|
"std.StringHashMap(": 0,
|
|
"std.StringHashMapUnmanaged(": 0,
|
|
"std.Thread.Mutex": 1,
|
|
"std.debug.assert": 26,
|
|
"std.debug.dumpStackTrace": 0,
|
|
"std.debug.print": 0,
|
|
"std.enums.tagName(": 2,
|
|
"std.fs.Dir": 170,
|
|
"std.fs.File": 62,
|
|
"std.fs.cwd": 104,
|
|
"std.log": 1,
|
|
"std.mem.indexOfAny(u8": 0,
|
|
"std.unicode": 33,
|
|
"undefined != ": 0,
|
|
"undefined == ": 0,
|
|
"usingnamespace": 0
|
|
} |