initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
35
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js
generated
vendored
Normal file
35
github/codeql-action-v2/node_modules/@protobuf-ts/runtime/build/commonjs/lower-camel-case.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lowerCamelCase = void 0;
|
||||
/**
|
||||
* Converts snake_case to lowerCamelCase.
|
||||
*
|
||||
* Should behave like protoc:
|
||||
* https://github.com/protocolbuffers/protobuf/blob/e8ae137c96444ea313485ed1118c5e43b2099cf1/src/google/protobuf/compiler/java/java_helpers.cc#L118
|
||||
*/
|
||||
function lowerCamelCase(snakeCase) {
|
||||
let capNext = false;
|
||||
const sb = [];
|
||||
for (let i = 0; i < snakeCase.length; i++) {
|
||||
let next = snakeCase.charAt(i);
|
||||
if (next == '_') {
|
||||
capNext = true;
|
||||
}
|
||||
else if (/\d/.test(next)) {
|
||||
sb.push(next);
|
||||
capNext = true;
|
||||
}
|
||||
else if (capNext) {
|
||||
sb.push(next.toUpperCase());
|
||||
capNext = false;
|
||||
}
|
||||
else if (i == 0) {
|
||||
sb.push(next.toLowerCase());
|
||||
}
|
||||
else {
|
||||
sb.push(next);
|
||||
}
|
||||
}
|
||||
return sb.join('');
|
||||
}
|
||||
exports.lowerCamelCase = lowerCamelCase;
|
||||
Loading…
Add table
Add a link
Reference in a new issue