Changeset View
Changeset View
Standalone View
Standalone View
lib/utils/sanitization.js
Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | function sanitizeState( | ||||
state: AppState, | state: AppState, | ||||
redactionHelpers: RedactionHelpers, | redactionHelpers: RedactionHelpers, | ||||
): AppState { | ): AppState { | ||||
if (state.cookie !== undefined && state.cookie !== null) { | if (state.cookie !== undefined && state.cookie !== null) { | ||||
const oldState: NativeAppState = state; | const oldState: NativeAppState = state; | ||||
state = { ...oldState, cookie: null }; | state = { ...oldState, cookie: null }; | ||||
} | } | ||||
if (state.deviceToken !== undefined && state.deviceToken !== null) { | if (state.deviceToken !== undefined && state.deviceToken !== null) { | ||||
const oldState: NativeAppState = state; | const oldState: AppState = state; | ||||
state = { ...oldState, deviceToken: null }; | state = { ...oldState, deviceToken: null }; | ||||
} | } | ||||
const stateCopy = clone(state); | const stateCopy = clone(state); | ||||
sanitizePII(stateCopy, redactionHelpers); | sanitizePII(stateCopy, redactionHelpers); | ||||
return stateCopy; | return stateCopy; | ||||
} | } | ||||
export { | export { | ||||
sanitizeActionSecrets, | sanitizeActionSecrets, | ||||
sanitizeAction, | sanitizeAction, | ||||
sanitizeState, | sanitizeState, | ||||
sanitizeReduxReport, | sanitizeReduxReport, | ||||
}; | }; |