MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / encodeBase64Fields

Function encodeBase64Fields

frontend/src/utils/base64.ts:9–19  ·  view source on GitHub ↗
(target: T, fields: Array<Extract<keyof T, string>>)

Source from the content-addressed store, hash-verified

7export const decodeBase64 = (value: string) => Base64.decode(value);
8
9export const encodeBase64Fields = <T extends StringLikeRecord>(target: T, fields: Array<Extract<keyof T, string>>) => {
10 fields.forEach((field) => {
11 const record = target as Record<string, unknown>;
12 const value = record[field];
13 if (typeof value === 'string' && value) {
14 record[field] = encodeBase64(value);
15 }
16 });
17
18 return target;
19};

Callers 15

addHostFunction · 0.90
testByInfoFunction · 0.90
editHostFunction · 0.90
updateProxyFunction · 0.90
createCertFunction · 0.90
editCertFunction · 0.90
checkBackupFunction · 0.90
listBucketFunction · 0.90
addBackupFunction · 0.90
editBackupFunction · 0.90
createFtpFunction · 0.90
updateFtpFunction · 0.90

Calls 1

encodeBase64Function · 0.85

Tested by

no test coverage detected