editor-api
editor-api copied to clipboard
Problem with capital letters in scriptName
Description
When I create a new script with for example the name 'lookAtScreen' then inside the script the result is 'lookAtscreen'. The S is no capital letter anymore. With for example 'thisIsABug' the result inside the script is 'thisIsAbug'. The B is no capital letter anymore. If I try 'testTestTest' then the result is as expected.


Steps to Reproduce
- Create a new script with some capital letters
- Check the result inside the script
Based on naming conventions been used: lookAtScreen should be lookAtScreen indeed. But thisIsABug should be thisIsAbug, as consecutive capital letters should be lower case. Like HTMLClass, should be HtmlClass, or RGB should be Rgb.
Ah ok I didn't know that. Then the problem is only when capital letters are used with only one normal letter in between.
The code responsible for this is here:
https://github.com/playcanvas/editor-api/blob/main/src/assets/createScript.js#L17