aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-07-06 15:44:48 -0700
committerGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-07-06 15:44:48 -0700
commitd377265b67df34495274ad7be9f8ad1852e3b23b (patch)
tree8eeb2b46ec3e314ba9aa2a7dfd8a7fad90c6293f
parenta415f482db09ae50474dd8b6258c4e5166e63670 (diff)
downloadbun-d377265b67df34495274ad7be9f8ad1852e3b23b.tar.gz
bun-d377265b67df34495274ad7be9f8ad1852e3b23b.tar.zst
bun-d377265b67df34495274ad7be9f8ad1852e3b23b.zip
Update trustedDeps doc
-rw-r--r--docs/cli/install.md4
-rw-r--r--packages/bun-types/tests/serve.test-d.ts10
2 files changed, 12 insertions, 2 deletions
diff --git a/docs/cli/install.md b/docs/cli/install.md
index c805b14f6..584350a42 100644
--- a/docs/cli/install.md
+++ b/docs/cli/install.md
@@ -234,7 +234,7 @@ Unlike other npm clients, Bun does not execute arbitrary lifecycle scripts for i
To tell Bun to allow lifecycle scripts for a particular package, add the package to `trustedDependencies` in your package.json.
-```json-diff
+<!-- ```json-diff
{
"name": "my-app",
"version": "1.0.0",
@@ -242,7 +242,7 @@ To tell Bun to allow lifecycle scripts for a particular package, add the package
+ "my-trusted-package": "*"
+ }
}
-```
+``` -->
```json-diff
{
diff --git a/packages/bun-types/tests/serve.test-d.ts b/packages/bun-types/tests/serve.test-d.ts
index 4ba3144b8..976466022 100644
--- a/packages/bun-types/tests/serve.test-d.ts
+++ b/packages/bun-types/tests/serve.test-d.ts
@@ -93,3 +93,13 @@ Bun.serve({
});
export {};
+
+Bun.serve({
+ port: 1234,
+ fetch(req, server) {
+ server.upgrade(req);
+ if (Math.random() > 0.5) return undefined;
+ return new Response();
+ },
+ websocket: { message() {} },
+});