Skip to content

Instantly share code, notes, and snippets.

@arsduo
Last active September 16, 2018 13:24
Show Gist options
  • Save arsduo/dc9f41f627b3450eaac5c33c41a3ecea to your computer and use it in GitHub Desktop.
Save arsduo/dc9f41f627b3450eaac5c33c41a3ecea to your computer and use it in GitHub Desktop.
Sanitizing History - example
watchWords: ["MySecretData", "password"],
historySanitizer: function(elmObjectOrRecord) {
// in 0.18, replace $ with ctor and a with _0
if (elmObjectOrRecord.$ == "MySecretData") {
// replace the access token
// make sure to return the updated object!
return { …elmObjectOrRecord, a: "[FILTERED]" };
else {
// we have a record, replace the password field
return { …elmObjectOrRecord, password: "[FILTERED]" };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment