serialize CI_params by index not key to be less space consuming and more like RPCs

pull/524/head
Frostebite 2023-03-15 20:18:49 +00:00
parent 29cf3ac259
commit f7fc3a37ad
3 changed files with 17 additions and 8 deletions

7
dist/index.js generated vendored
View File

@ -5542,11 +5542,14 @@ class TaskParameterSerializer {
return this.camelize(element.replace('CI_', '').toLowerCase().replace(/_+/g, ' '));
}
static camelize(string) {
return string
return TaskParameterSerializer.uncapitalizeFirstLetter(string
.replace(/(^\w)|([A-Z])|(\b\w)/g, function (word, index) {
return index === 0 ? word.toLowerCase() : word.toUpperCase();
})
.replace(/\s+/g, '');
.replace(/\s+/g, ''));
}
static uncapitalizeFirstLetter(string) {
return string.charAt(0).toLowerCase() + string.slice(1);
}
static serializeFromObject(buildParameters) {
const array = [];

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -94,11 +94,17 @@ export class TaskParameterSerializer {
}
private static camelize(string: string) {
return string
.replace(/(^\w)|([A-Z])|(\b\w)/g, function (word: string, index: number) {
return index === 0 ? word.toLowerCase() : word.toUpperCase();
})
.replace(/\s+/g, '');
return TaskParameterSerializer.uncapitalizeFirstLetter(
string
.replace(/(^\w)|([A-Z])|(\b\w)/g, function (word: string, index: number) {
return index === 0 ? word.toLowerCase() : word.toUpperCase();
})
.replace(/\s+/g, ''),
);
}
private static uncapitalizeFirstLetter(string: string) {
return string.charAt(0).toLowerCase() + string.slice(1);
}
private static serializeFromObject(buildParameters: any) {