Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
dummdidumm committed Aug 28, 2024
1 parent 6cbc05b commit 21c8a68
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/modules/tagInfo.ts
Original file line number Diff line number Diff line change
@@ -70,5 +70,6 @@ export const getTagInfo = async ({

export const removeSrcAttribute = (attributes: Record<string, any>) => {
const { src, ...rest } = attributes;

return rest;
};
16 changes: 7 additions & 9 deletions src/transformers/globalStyle.ts
Original file line number Diff line number Diff line change
@@ -83,18 +83,16 @@ const transformer: Transformer<Options.GlobalStyle> = async ({
map: options?.sourceMap ? { prev: map } : false,
});

if (attributes?.global) {
const { global, ...rest } = attributes;

attributes = rest;
}

return {
code: css,
map: newMap,
attributes:
attributes &&
Object.keys(attributes).reduce((acc: any, key) => {
if (key !== 'global') {
acc[key] = attributes[key];
}

return acc;
}, {}),
attributes,
};
};

0 comments on commit 21c8a68

Please sign in to comment.