diff --git a/docs/runtime/yaml.mdx b/docs/runtime/yaml.mdx index d4e6f7cb2c..7e3b67801b 100644 --- a/docs/runtime/yaml.mdx +++ b/docs/runtime/yaml.mdx @@ -506,30 +506,30 @@ You can use `Bun.YAML.stringify()` to programmatically create YAML configuration import { YAML } from "bun"; const defaults = { - timeout: 30000, - retries: 3, +timeout: 30000, +retries: 3, }; const config = { - defaults, - development: { - defaults, - host: "localhost", - port: 3000, - }, - production: { - defaults, - host: "api.example.com", - port: 443, - }, - servers: [ - { name: "server1", url: "https://api1.example.com" }, - { name: "server2", url: "https://api2.example.com" }, - ], - features: { - enabled: ["auth", "logging", "metrics"], - disabled: ["experimental"], - }, +defaults, +development: { +defaults, +host: "localhost", +port: 3000, +}, +production: { +defaults, +host: "api.example.com", +port: 443, +}, +servers: [ +{ name: "server1", url: "https://api1.example.com" }, +{ name: "server2", url: "https://api2.example.com" }, +], +features: { +enabled: ["auth", "logging", "metrics"], +disabled: ["experimental"], +}, }; // Generate readable YAML with 2-space indentation @@ -539,7 +539,8 @@ await Bun.write("config.yaml", yaml); // The output is valid YAML that parses back to the original object import { deepEqual } from "node:assert"; deepEqual(config, Bun.YAML.parse(yaml)); -``` + +```` ```yaml output.yaml icon="file-code" defaults: @@ -568,7 +569,7 @@ features: - metrics disabled: - experimental -``` +```` @@ -604,4 +605,3 @@ async function loadUserSettings(userId: string) { } } ``` -