-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96b5dac
commit 6f7b65a
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
"@statelyai/inspect": minor | ||
--- | ||
|
||
Added new options `sanitizeContext` and `sanitizeEvent` to the inspector configuration. These options allow users to sanitize sensitive data from the context and events before they are sent to the inspector, and also to remove non-serializable data. | ||
|
||
Example usage: | ||
|
||
```typescript | ||
const inspector = createInspector({ | ||
sanitizeContext: (context) => { | ||
// Remove sensitive data from context | ||
const { password, ...safeContext } = context; | ||
return safeContext; | ||
}, | ||
sanitizeEvent: (event) => { | ||
// Remove sensitive data from event | ||
if (event.type === 'SUBMIT_FORM') { | ||
const { creditCardNumber, ...safeEvent } = event; | ||
return safeEvent; | ||
} | ||
return event; | ||
} | ||
}); |