-
Notifications
You must be signed in to change notification settings - Fork 299
feat(sync): 第一波 - 合入 feat_v3.x_cpp 独立工具与白皮书规范 #3521
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
Open
xiaoyatong
wants to merge
1
commit into
feat_v3.x
Choose a base branch
from
feat_v3.x_batch1_new_modules
base: feat_v3.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| // 按词法边界分词后用 `-` 连接并小写,输出与 lodash kebabCase 的 ASCII 结果一致 | ||
| // 分词规则对齐 lodash 的 unicodeWords:数字独立成词,连续大写段遇到「大写+小写」时断开 | ||
| const reWords = | ||
| /[A-Z]?[a-z]+(?=[^a-z]|$)|[A-Z]+(?=[A-Z][a-z]|[^A-Za-z]|$)|[A-Z]?[a-z]+|[A-Z]+|\d+/g | ||
|
|
||
| export const kebabCase = (str: string) => { | ||
| const words = String(str).match(reWords) | ||
| return words ? words.map((word) => word.toLowerCase()).join('-') : '' | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: jdf2e/nutui-react
Length of output: 50373
🤖 get_repo_knowledge executed:
get_repo_knowledge jdf2e/nutui-react /tmp/coderabbit-repo-knowledge/jdf2e-nutui-react-8a0b45ec/learningsLength of output: 991
🏁 Script executed:
Repository: jdf2e/nutui-react
Length of output: 6803
🌐 Web query:
lodash kebabcase 4.1.1 source apostrophe deburr unicodeWords behavior💡 Result:
In Lodash (including version 4.17.21), the _.kebabCase function performs specific normalization steps on the input string to ensure consistent output [1][2]. Apostrophes and Unicode Behavior: The function automatically removes apostrophes and diacritical marks from the input string [3][4][5]. This is achieved by invoking the _.deburr method as part of its internal implementation [6][7]. Specifically, _.deburr converts Latin-1 Supplementary letters to their basic Latin equivalents and removes combining diacritical marks [3][7]. Because _.kebabCase uses this normalization, characters like those with accents are stripped of their diacritics (e.g., "ö" becomes "o"), and apostrophes are typically removed to simplify word splitting [3][5]. Implementation Details: _.kebabCase is implemented using a compounder function (often named createCompounder in Lodash's source) that breaks the input string into individual words [6][2]. It relies on internal regular expressions to identify these words, specifically leveraging logic that handles Unicode characters to ensure it can correctly identify and split word boundaries [2]. By design, this process enforces a uniform transformation, which allows the library to reliably convert strings between various formats like kebab-case, snake_case, and camelCase [3][7]. This behavior is standard for Lodash's case-manipulation methods (such as _.camelCase, _.snakeCase, and _.startCase), all of which share this deburring and word-splitting logic [6][7][2].
Citations:
🏁 Script executed:
Repository: jdf2e/nutui-react
Length of output: 18008
🌐 Web query:
site:github.com/lodash/lodash/blob 4.1.1 lodash.kebabcase index.js createCompounder deburr reApos💡 Result:
In Lodash, _.kebabCase is a string utility function used to convert strings into kebab-case [1][2]. The implementation of _.kebabCase typically utilizes a internal helper function often referred to as createCompounder. The createCompounder function is a higher-order function used to generate various casing transformation methods, such as camelCase, snakeCase, and kebabCase. It works by taking a predicate or a specific logic set to process the string, split it into words, and then rejoin them with a specific separator—in the case of kebabCase, a hyphen (-). Within the logic used by these compounders to tokenize strings, reApos (often represented as a regular expression) is used to handle apostrophes. Its primary purpose is to identify and manage apostrophes within words (for example, by removing them or treating them as word boundaries) during the tokenization process, ensuring that contractions like "don't" are handled predictably (e.g., converting "don't" to "dont" or splitting it correctly) when generating the final compound string. Regarding deburr, it is another string utility function in Lodash that converts Latin-1 Supplement and Latin Extended-A letters to basic Latin letters and removes combining diacritical marks (e.g., converting 'déjà vu' to 'deja vu') [3]. When generating compound strings, Lodash often applies deburr as a preliminary step to ensure the string is normalized before it is split into words by the compounder.
Citations:
保持与
lodash.kebabcase@4.1.1的词法语义一致。reWords仅匹配 ASCII 字母和数字。当前结果为kebabCase("don't") === "don-t",而 Lodash 结果为"dont";kebabCase("déjà vu")也会丢弃重音字符。ConfigProvider的两个实现会使用该结果生成cssVars,不同主题键可能因此映射到同一个 CSS 变量名,后写入的值会覆盖先写入的值。请补充兼容行为和差异测试,或明确将
kebabCase限制为 ASCII 标识符。🤖 Prompt for AI Agents
Source: MCP tools