Skip to content

Commit

Permalink
Add lower camel case (#6251)
Browse files Browse the repository at this point in the history
  • Loading branch information
marklundin authored Apr 12, 2024
1 parent eaf96f1 commit 6277c94
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/framework/handlers/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { ResourceLoader } from './loader.js';
import { ResourceHandler } from './handler.js';
import { ScriptAttributes } from '../script/script-attributes.js';

const toLowerCamelCase = str => str[0].toLowerCase() + str.substring(1);

/**
* Resource handler for loading JavaScript files dynamically. Two types of JavaScript files can be
* loaded, PlayCanvas scripts which contain calls to {@link createScript}, or regular JavaScript
Expand Down Expand Up @@ -164,7 +166,7 @@ class ScriptHandler extends ResourceHandler {
}
scriptClass.attributes = attributes;
}
registerScript(scriptClass, scriptClass.name.toLowerCase());
registerScript(scriptClass, toLowerCamelCase(scriptClass.name));
}
}

Expand Down

0 comments on commit 6277c94

Please sign in to comment.