|
|
|
@ -1,21 +1,16 @@
|
|
|
|
/** @param {ConstTag[]} const_tags */
|
|
|
|
/** @param {ConstTag[]} const_tags */
|
|
|
|
export function get_const_tags(const_tags) {
|
|
|
|
export function get_const_tags(const_tags) {
|
|
|
|
if (const_tags.length === 0)
|
|
|
|
if (const_tags.length === 0) return null;
|
|
|
|
return null;
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
type: 'VariableDeclaration',
|
|
|
|
type: 'VariableDeclaration',
|
|
|
|
kind: 'let',
|
|
|
|
kind: 'let',
|
|
|
|
declarations: const_tags.map((const_tag) => {
|
|
|
|
declarations: const_tags.map((const_tag) => {
|
|
|
|
const assignment = const_tag.node.expression;
|
|
|
|
const assignment = const_tag.node.expression;
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
type: 'VariableDeclarator',
|
|
|
|
type: 'VariableDeclarator',
|
|
|
|
id: assignment.left,
|
|
|
|
id: assignment.left,
|
|
|
|
init: assignment.right
|
|
|
|
init: assignment.right
|
|
|
|
};
|
|
|
|
};
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|