Skip to content

Commit 21c8a68

Browse files
committed
code style
1 parent 6cbc05b commit 21c8a68

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

src/modules/tagInfo.ts

+1
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,6 @@ export const getTagInfo = async ({
7070

7171
export const removeSrcAttribute = (attributes: Record<string, any>) => {
7272
const { src, ...rest } = attributes;
73+
7374
return rest;
7475
};

src/transformers/globalStyle.ts

+7-9
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,16 @@ const transformer: Transformer<Options.GlobalStyle> = async ({
8383
map: options?.sourceMap ? { prev: map } : false,
8484
});
8585

86+
if (attributes?.global) {
87+
const { global, ...rest } = attributes;
88+
89+
attributes = rest;
90+
}
91+
8692
return {
8793
code: css,
8894
map: newMap,
89-
attributes:
90-
attributes &&
91-
Object.keys(attributes).reduce((acc: any, key) => {
92-
if (key !== 'global') {
93-
acc[key] = attributes[key];
94-
}
95-
96-
return acc;
97-
}, {}),
95+
attributes,
9896
};
9997
};
10098

0 commit comments

Comments
 (0)