From 909201927f03d05ef9287a46e645e9a468850edc Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 12 May 2023 12:13:19 +0200 Subject: [PATCH] Convert src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts to JavaScript --- .../handlers/shared/get_const_tags.js | 2 +- .../handlers/shared/get_slot_scope.ts | 43 +++++++++++-------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.js b/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.js index e7537b73bc..3fadb86cd2 100644 --- a/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.js +++ b/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.js @@ -1,4 +1,4 @@ -/** @param {ConstTag[]} const_tags */ +/** @param {import('../../../nodes/ConstTag.js').default[]} const_tags */ export function get_const_tags(const_tags) { if (const_tags.length === 0) return null; return { diff --git a/src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts b/src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts index 17dca3dead..e11b274f14 100644 --- a/src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts +++ b/src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts @@ -1,21 +1,26 @@ -import Let from '../../../nodes/Let'; -import { ObjectPattern } from 'estree'; +/** + * @param {Let[]} lets + * @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").ObjectPattern} + */ +export function get_slot_scope(lets) { + if (lets.length === 0) + return null; + return { + type: 'ObjectPattern', + properties: lets.map((l) => { + return { + type: 'Property', + kind: 'init', + method: false, + shorthand: false, + computed: false, + key: l.name, + value: l.value || l.name + }; + }) + }; +} + + -export function get_slot_scope(lets: Let[]): ObjectPattern { - if (lets.length === 0) return null; - return { - type: 'ObjectPattern', - properties: lets.map((l) => { - return { - type: 'Property', - kind: 'init', - method: false, - shorthand: false, - computed: false, - key: l.name, - value: l.value || l.name - }; - }) - }; -}