From 85d923178b4c371be3e2e42be42a3803f06a36bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Kishi?= Date: Thu, 17 Mar 2022 09:49:14 -0300 Subject: [PATCH] fix rest param type generation (#4361) * fix rest param type generation * Create happy-eggs-shop.md Co-authored-by: Rich Harris --- .changeset/happy-eggs-shop.md | 5 +++++ packages/kit/src/core/sync/write_types.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/happy-eggs-shop.md diff --git a/.changeset/happy-eggs-shop.md b/.changeset/happy-eggs-shop.md new file mode 100644 index 000000000000..0e13c7b40732 --- /dev/null +++ b/.changeset/happy-eggs-shop.md @@ -0,0 +1,5 @@ +--- +"@sveltejs/kit": patch +--- + +fix rest param type generation diff --git a/packages/kit/src/core/sync/write_types.js b/packages/kit/src/core/sync/write_types.js index fe0f2dabf8d4..881ec07c4b9b 100644 --- a/packages/kit/src/core/sync/write_types.js +++ b/packages/kit/src/core/sync/write_types.js @@ -29,7 +29,7 @@ export function write_types(config, manifest_data) { /** @type {string[]} */ const params = []; - const pattern = /\[([^\]]+)\]/g; + const pattern = /\[(?:\.{3})?([^\]]+)\]/g; let match; while ((match = pattern.exec(key))) {