Convert src/compiler/compile/render_ssr/handlers/shared/get_slot_scope.ts to JavaScript

pull/8569/head
Simon Holthausen 3 years ago
parent f57591cf06
commit 909201927f

@ -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 {

@ -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
};
})
};
}

Loading…
Cancel
Save