Skip to content

Use ordinal character comparison in TS NaturalComparer - #39

Merged
jogibear9988 merged 1 commit into
mainfrom
fix/ts-natural-comparer-ordinal
Oct 5, 2026
Merged

jogibear9988 merged 1 commit into
mainfrom
fix/ts-natural-comparer-ordinal

Conversation

@guertel

@guertel guertel commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

The C# NaturalComparer compares non-digit characters with char.ToUpperInvariant(cx).CompareTo(...), which is ordinal. The TS port used localeCompare, which sorts '_' before '.' and therefore assigned UIds in a different order than the C# version (e.g. GroupSignals.1_1 before GroupSignals.1).

The C# NaturalComparer compares non-digit characters with
char.ToUpperInvariant(cx).CompareTo(...), which is ordinal. The TS port
used localeCompare, which sorts '_' before '.' and therefore assigned
UIds in a different order than the C# version (e.g. GroupSignals.1_1
before GroupSignals.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jogibear9988
jogibear9988 merged commit de77852 into main Oct 5, 2026
1 check passed
@jogibear9988
jogibear9988 deleted the fix/ts-natural-comparer-ordinal branch October 5, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants