Skip to content

Commit f529619

Browse files
fix(apiclient): remove deprecated private function toUpperCaseKeys
1 parent c9a4664 commit f529619

File tree

4 files changed

+14
-35
lines changed

4 files changed

+14
-35
lines changed

dist/src/apiclient.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export declare class APIClient {
4545
useOTESystem(): APIClient;
4646
useLIVESystem(): APIClient;
4747
getPOSTData(cmd: any, secured?: boolean): string;
48-
private toUpperCaseKeys;
4948
private flattenCommand;
5049
private autoIDNConvert;
5150
}

dist/src/apiclient.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/src/apiclient.js

Lines changed: 7 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/apiclient.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -516,41 +516,28 @@ export class APIClient {
516516
return data;
517517
}
518518

519-
/**
520-
* Translate all command parameter names to uppercase
521-
* @param cmd api command
522-
* @returns api command with uppercase parameter names
523-
*/
524-
private toUpperCaseKeys(cmd: any): any {
525-
const newcmd: any = {};
526-
Object.keys(cmd).forEach((k: string) => {
527-
newcmd[k.toUpperCase()] = cmd[k];
528-
});
529-
return newcmd;
530-
}
531-
532519
/**
533520
* Flatten nested arrays in command
534521
* @param cmd api command
535522
* @returns api command with flattended parameters
536523
*/
537524
private flattenCommand(cmd: any): any {
538-
const mycmd = this.toUpperCaseKeys(cmd);
539525
const newcmd: any = {};
540-
Object.keys(mycmd).forEach((key: string) => {
541-
const val = mycmd[key];
526+
Object.keys(cmd).forEach((key: string) => {
527+
const val = cmd[key];
528+
const newKey = key.toUpperCase();
542529
if (val !== null && val !== undefined) {
543530
if (Array.isArray(val)) {
544531
let index = 0;
545532
for (const row of val) {
546-
newcmd[`${key}${index}`] = (row + "").replace(/\r|\n/g, "");
533+
newcmd[`${newKey}${index}`] = (row + "").replace(/\r|\n/g, "");
547534
index++;
548535
}
549536
} else {
550537
if (typeof val === "string" || val instanceof String) {
551-
newcmd[key] = val.replace(/\r|\n/g, "");
538+
newcmd[newKey] = val.replace(/\r|\n/g, "");
552539
} else {
553-
newcmd[key] = val;
540+
newcmd[newKey] = val;
554541
}
555542
}
556543
}

0 commit comments

Comments
 (0)