Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Bentlybro committed Dec 19, 2024
1 parent 751ee2a commit a8dadbd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autogpt_platform/frontend/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,12 @@ const applyExceptions = (str: string): string => {

/** Recursively remove all "credentials" properties from exported JSON files */
export function removeCredentials(obj: any) {
if (obj && typeof obj === 'object') {
if (obj && typeof obj === "object") {
if (Array.isArray(obj)) {
obj.forEach(item => removeCredentials(item));
obj.forEach((item) => removeCredentials(item));
} else {
delete obj.credentials;
Object.values(obj).forEach(value => removeCredentials(value));
Object.values(obj).forEach((value) => removeCredentials(value));
}
}
return obj;
Expand All @@ -136,7 +136,7 @@ export function removeCredentials(obj: any) {
export function exportAsJSONFile(obj: object, filename: string): void {
// Deep clone the object to avoid modifying the original
const sanitizedObj = JSON.parse(JSON.stringify(obj));

// Sanitize the object
removeCredentials(sanitizedObj);

Expand Down

0 comments on commit a8dadbd

Please sign in to comment.