Skip to content

Commit

Permalink
Add length check
Browse files Browse the repository at this point in the history
  • Loading branch information
jasongin committed Oct 15, 2024
1 parent 72d5a06 commit 2f56f60
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/NodeApi.DotNetHost/JSMarshaller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ public static string ToCamelCase(string name)
while (name[firstLetterIndex] == '_')
{
firstLetterIndex++;
if (firstLetterIndex == name.Length)
{
// Only underscores.
return name;
}
}

// Only convert if it looks like title-case. (Avoid converting ALLCAPS.)
Expand Down

0 comments on commit 2f56f60

Please sign in to comment.