mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 14:56:19 -04:00
WIP: generate top level node exports - manually mock lib files
This commit is contained in:
parent
0977e82170
commit
0a0240e520
5 changed files with 125 additions and 38 deletions
|
@ -163,9 +163,14 @@ export function help(operations, searchTerm) {
|
|||
* @returns {String} decapitalised
|
||||
*/
|
||||
export function decapitalise(name) {
|
||||
// Don't decapitalise names that are purely uppercase
|
||||
if (/^[A-Z0-9]+$/g.test(name)) {
|
||||
// Don't decapitalise names that start with 2+ caps
|
||||
if (/^[A-Z0-9]{2,}/g.test(name)) {
|
||||
return name;
|
||||
}
|
||||
// reserved. Don't change for now.
|
||||
if (name === "Return") {
|
||||
return name;
|
||||
}
|
||||
|
||||
return `${name.charAt(0).toLowerCase()}${name.substr(1)}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue