-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
- Expected Output:
getSignedReplayProtectionPacketHash - Actual Output:
getSignedreplayprotectionPacketHash
To Reproduce:
Setup
git clone git@github.com:danfinlay/eip712-codegen.git
git checkout 73b411e83250755c2a1bd068d9f5eaf7b42be039
cd eip712-codegen
yarn installRun
node cli.js --input sampleTypes.js --entryPoints ReplayProtection > ReplayProtection.solRoot Cause
It seems the function camelCase is not being called properly.
For example
Lines 5 to 9 in 73b411e
| function camelCase (str) { | |
| return str.toLowerCase().replace(/_(.)/g, function(match, group1) { | |
| return group1.toUpperCase(); | |
| }); | |
| } |
- Input:
camelCase("FooBar") - Expected Output:
fooBar - Actual Output:
foobar
It seems the root cause is that the camelCase above is meant to convert snake_case or SCREAMING_SNAKE_CASE into camelCase.
-
Input:
camelCase("foo_bar") -
Expected Output:
fooBar -
Actual Output:
fooBar(same as Expected Output) -
Input:
camelCase("FOO_BAR") -
Expected Output:
fooBar -
Actual Output:
fooBar(same as Expected Output)
Therefore, I'd suggest make the following update:
- Rename
camelCasetosnakeToCamelCase - Add assertion that the input is
snake_caseandSCREAMING_SNAKE_CASE
Metadata
Metadata
Assignees
Labels
No labels