From 5426901a710f5e412bd8d3bf2c78bd9df283b2a2 Mon Sep 17 00:00:00 2001 From: Chris Kerr Date: Fri, 6 Jan 2023 08:51:13 +1000 Subject: [PATCH] Update request type definitions to make platform possibly undefined (#8232) * fallback platform to empty object * Update .changeset/shy-monkeys-raise.md * mark platform type as possibly undefined instead * Update packages/kit/types/index.d.ts * Update .changeset/shy-monkeys-raise.md Co-authored-by: Conduitry * Update packages/kit/types/index.d.ts Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com> Co-authored-by: Rich Harris Co-authored-by: Conduitry --- .changeset/shy-monkeys-raise.md | 5 +++++ packages/kit/types/index.d.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/shy-monkeys-raise.md diff --git a/.changeset/shy-monkeys-raise.md b/.changeset/shy-monkeys-raise.md new file mode 100644 index 000000000000..e19249fb0032 --- /dev/null +++ b/.changeset/shy-monkeys-raise.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +Update typings of `event.platform` to be possibly undefined diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index d41d2050298d..2944b989c348 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -865,7 +865,7 @@ export interface RequestEvent< /** * Additional data made available through the adapter. */ - platform: Readonly; + platform: Readonly | undefined; /** * The original request object */