Skip to content

Commit

Permalink
fix: Resolved type issues during style declarations array traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
youthfulhps committed Jul 3, 2024
1 parent 8329da3 commit 88cdae0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@youthfulhps/tailwind-converter",
"version": "0.8.1",
"version": "0.8.2",
"description": "Converts files written in css-in-js to tailwindCSS.",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/css-converter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function convertStyles(styles: StyleRule[]) {

return rules
.reduce((combinedStyles, rule) => {
const selectors = convertSelector(rule.selectors);
const selectors = convertSelector(rule?.selectors ?? []);
const utilities = rule.declarations.map((declaration: StyleDeclaration) =>
convertCss(declaration),
);
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/css-converter/preprocessor/shorthand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function preprocessShorthand(styleRules: StyleRule[]) {

return {
...styleRule,
declarations: styleRule.declarations.reduce((sum, curr) => {
declarations: (styleRule?.declarations ?? []).reduce((sum, curr) => {
switch (curr.property) {
case 'padding':
case 'margin':
Expand Down

0 comments on commit 88cdae0

Please sign in to comment.