Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: logical attribute calc css variable logic error #177

Merged
merged 6 commits into from
Mar 13, 2024

Conversation

Wxh16144
Copy link
Member

@Wxh16144 Wxh16144 commented Feb 29, 2024

@MadCcc
Copy link
Member

MadCcc commented Mar 4, 2024


这里加个空格应该就可以

@codecov-commenter
Copy link

codecov-commenter commented Mar 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.80%. Comparing base (907a22b) to head (6c8152d).

❗ Current head 6c8152d differs from pull request most recent head a79f96a. Consider uploading reports for the commit a79f96a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #177      +/-   ##
==========================================
- Coverage   94.80%   94.80%   -0.01%     
==========================================
  Files          29       29              
  Lines        2619     2618       -1     
  Branches      394      393       -1     
==========================================
- Hits         2483     2482       -1     
  Misses        136      136              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

temp = '';
} else if (brackets > 0) {
temp += item;
temp += ` ${item}`;
Copy link
Contributor

@yoyo837 yoyo837 Mar 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥不都用数组push, 然后最终join(' ')呢?字符串玩着玩着容易玩出这种问题。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉这段代码已经比较精简了,没有可操作空间了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  let temp: string[] = [];
  let brackets = 0;
  return [
    splitStyle.reduce<string[]>((list, item) => {
      if (item.includes('(') || item.includes(')')) {
        const left = item.split('(').length - 1;
        const right = item.split(')').length - 1;
        brackets += left - right;
      }
      if (brackets >= 0) {
        temp.push(item);
      }
      if (brackets === 0) {
        list.push(temp.join(' '));
        temp = [];
      }
      return list;
    }, []),
    !!importantCells,
  ];

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yoyo837 可以直接用 suggestion 能力。

图片

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

跨越很多行,还涉及一些未修改的行,这种情况我不会 suggestion

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

push 了,再 review 一下吧

Co-authored-by: yoyo837 <yoyo837@users.noreply.github.com>
@MadCcc MadCcc merged commit ae339d1 into ant-design:master Mar 13, 2024
8 checks passed
@@ -25,11 +25,10 @@ function splitValues(
const right = item.split(')').length - 1;
brackets += left - right;
}
if (brackets >= 0) temp.push(item);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不省略括号好一些

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants