diff --git a/src/compiler/compile/render_ssr/handlers/shared/get_attribute_value.js b/src/compiler/compile/render_ssr/handlers/shared/get_attribute_value.js index da6f727e95..fb3136cc85 100644 --- a/src/compiler/compile/render_ssr/handlers/shared/get_attribute_value.js +++ b/src/compiler/compile/render_ssr/handlers/shared/get_attribute_value.js @@ -4,7 +4,7 @@ import { regex_double_quotes } from '../../../../utils/patterns.js'; /** * @param {import('../../../nodes/Attribute.js').default} attribute - * @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").Expression} + * @returns {import('estree').Expression} */ export function get_class_attribute_value(attribute) { // handle special case — `class={possiblyUndefined}` with scoped CSS @@ -24,7 +24,7 @@ export function get_class_attribute_value(attribute) { /** * @param {import('../../../nodes/Attribute.js').default} attribute - * @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").Expression} + * @returns {import('estree').Expression} */ export function get_attribute_value(attribute) { if (attribute.chunks.length === 0) return x`""`; @@ -37,7 +37,7 @@ export function get_attribute_value(attribute) { return attribute.chunks .map((chunk) => { return chunk.type === 'Text' - ? /** @type {ESTreeExpression} */ ( + ? /** @type {import('estree').Expression} */ ( string_literal(chunk.data.replace(regex_double_quotes, '"')) ) : x`@escape(${chunk.node}, ${is_textarea_value ? 'false' : 'true'})`; @@ -47,11 +47,11 @@ export function get_attribute_value(attribute) { /** * @param {import('../../../nodes/Attribute.js').default} attribute - * @returns {import("C:/repos/svelte/svelte/node_modules/.pnpm/@types+estree@1.0.0/node_modules/@types/estree/index").Expression} + * @returns {import('estree').Expression} */ export function get_attribute_expression(attribute) { if (attribute.chunks.length === 1 && attribute.chunks[0].type === 'Expression') { - return /** @type {ESTreeExpression} */ ( + return /** @type {import('estree').Expression} */ ( /** @type {import('../../../nodes/shared/Expression.js').default} */ (attribute.chunks[0]) .node ); diff --git a/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.ts b/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.ts index 3a64f74fd6..358154dee1 100644 --- a/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.ts +++ b/src/compiler/compile/render_ssr/handlers/shared/get_const_tags.ts @@ -1,17 +1,21 @@ -import ConstTag from '../../../nodes/ConstTag'; - -export function get_const_tags(const_tags: ConstTag[]) { - if (const_tags.length === 0) return null; - return { - type: 'VariableDeclaration', - kind: 'let', - declarations: const_tags.map((const_tag) => { - const assignment = const_tag.node.expression; - return { - type: 'VariableDeclarator', - id: assignment.left, - init: assignment.right - }; - }) - }; +/** @param {ConstTag[]} const_tags */ +export function get_const_tags(const_tags) { + if (const_tags.length === 0) + return null; + return { + type: 'VariableDeclaration', + kind: 'let', + declarations: const_tags.map((const_tag) => { + const assignment = const_tag.node.expression; + return { + type: 'VariableDeclarator', + id: assignment.left, + init: assignment.right + }; + }) + }; } + + + +