MCPcopy
hub / github.com/ChatGPTNextWeb/NextChat / capitalizeKeys

Function capitalizeKeys

app/client/platforms/tencent.ts:51–64  ·  view source on GitHub ↗
(obj: any)

Source from the content-addressed store, hash-verified

49}
50
51function capitalizeKeys(obj: any): any {
52 if (isArray(obj)) {
53 return obj.map(capitalizeKeys);
54 } else if (isObject(obj)) {
55 return mapValues(
56 mapKeys(obj, (value: any, key: string) =>
57 key.replace(/(^|_)(\w)/g, (m, $1, $2) => $2.toUpperCase()),
58 ),
59 capitalizeKeys,
60 );
61 } else {
62 return obj;
63 }
64}
65
66export class HunyuanApi implements LLMApi {
67 path(): string {

Callers 1

chatMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected