diff options
author | 2023-05-31 13:43:08 -0700 | |
---|---|---|
committer | 2023-05-31 13:43:08 -0700 | |
commit | 4b34a7ce2ab233e51fc0bc5ee5b1ddc0e40b438b (patch) | |
tree | c300d846e499f8bca2b85bd364ae406a08d76b5d /docs/bundler/macros.md | |
parent | b284e09ce5bdac76c234cdda7a07009b8d002b9b (diff) | |
download | bun-4b34a7ce2ab233e51fc0bc5ee5b1ddc0e40b438b.tar.gz bun-4b34a7ce2ab233e51fc0bc5ee5b1ddc0e40b438b.tar.zst bun-4b34a7ce2ab233e51fc0bc5ee5b1ddc0e40b438b.zip |
Update macro serialization doc
Diffstat (limited to '')
-rw-r--r-- | docs/bundler/macros.md | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/bundler/macros.md b/docs/bundler/macros.md index 53aa01558..e2693de71 100644 --- a/docs/bundler/macros.md +++ b/docs/bundler/macros.md @@ -103,7 +103,7 @@ export async function getText() { The transpiler implements specicial logic for serializing common data formats like `Response`, `Blob`, `TypedArray`. - `TypedArray`: Resolves to a base64-encoded string. -- `Response`: Where relevant, Bun will read the `Content-Type` and serialize accordingly; for instance, a `Response` with type `application/json` will be automatically parsed into an object. Otherwise, it will be resolved with `resp.text()`. +- `Response`: Bun will read the `Content-Type` and serialize accordingly; for instance, a `Response` with type `application/json` will be automatically parsed into an object and `text/plain` will be inlined as a string. Responses with an unrecognized or `undefined` `type` will be base-64 encoded. - `Blob`: As with `Response`, the serialization depends on the `type` property. The result of `fetch` is `Promise<Response>`, so it can be directly returned. |