diff --git a/src/NodeApi.DotNetHost/JSMarshaller.cs b/src/NodeApi.DotNetHost/JSMarshaller.cs index 427d001e..612e3d20 100644 --- a/src/NodeApi.DotNetHost/JSMarshaller.cs +++ b/src/NodeApi.DotNetHost/JSMarshaller.cs @@ -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.)