[ci] format
This commit is contained in:
parent
f40065f510
commit
bc5cb85232
1 changed files with 8 additions and 12 deletions
|
@ -58,31 +58,27 @@ export default function tagExportsWithRenderer({
|
|||
const addTag = (id: string) => {
|
||||
const tags = state.get('astro:tags') ?? [];
|
||||
state.set('astro:tags', [...tags, id]);
|
||||
}
|
||||
};
|
||||
|
||||
if (node.type === 'ExportNamedDeclaration' || node.type === 'ExportDefaultDeclaration') {
|
||||
if (t.isIdentifier(node.declaration)) {
|
||||
addTag(node.declaration.name);
|
||||
}
|
||||
else if (t.isFunctionDeclaration(node.declaration) && node.declaration.id?.name) {
|
||||
} else if (t.isFunctionDeclaration(node.declaration) && node.declaration.id?.name) {
|
||||
addTag(node.declaration.id.name);
|
||||
}
|
||||
else if (t.isVariableDeclaration(node.declaration)) {
|
||||
node.declaration.declarations?.forEach(declaration => {
|
||||
} else if (t.isVariableDeclaration(node.declaration)) {
|
||||
node.declaration.declarations?.forEach((declaration) => {
|
||||
if (t.isArrowFunctionExpression(declaration.init) && t.isIdentifier(declaration.id)) {
|
||||
addTag(declaration.id.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (t.isObjectExpression(node.declaration)) {
|
||||
node.declaration.properties?.forEach(property => {
|
||||
} else if (t.isObjectExpression(node.declaration)) {
|
||||
node.declaration.properties?.forEach((property) => {
|
||||
if (t.isProperty(property) && t.isIdentifier(property.key)) {
|
||||
addTag(property.key.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (t.isExportNamedDeclaration(node)) {
|
||||
node.specifiers.forEach(specifier => {
|
||||
} else if (t.isExportNamedDeclaration(node)) {
|
||||
node.specifiers.forEach((specifier) => {
|
||||
if (t.isExportSpecifier(specifier) && t.isIdentifier(specifier.exported)) {
|
||||
addTag(specifier.local.name);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue