Metrics adjustments (#15313)
* Don't send errors to sentry if users have not opted-in to participate in metametrics * Don't capture opt-out metrics * Move the metrics-opt in screen to immediately after the welcome screen * Ensure that global.getSentryState is set in the background * Fix e2e tests after rearranging onboardin flow * Fix unit tests * More e2e test fixes * Remove unnecessary wrappers around capture exceptionfeature/default_network_editable
parent
80c830373e
commit
101fe0b27a
@ -0,0 +1,22 @@ |
|||||||
|
/** |
||||||
|
* Return a "masked" copy of the given object. |
||||||
|
* |
||||||
|
* The returned object includes only the properties present in the mask. The |
||||||
|
* mask is an object that mirrors the structure of the given object, except |
||||||
|
* the only values are `true` or a sub-mask. `true` implies the property |
||||||
|
* should be included, and a sub-mask implies the property should be further |
||||||
|
* masked according to that sub-mask. |
||||||
|
* |
||||||
|
* @param {Object} object - The object to mask |
||||||
|
* @param {Object<Object|boolean>} mask - The mask to apply to the object |
||||||
|
*/ |
||||||
|
export function maskObject(object, mask) { |
||||||
|
return Object.keys(object).reduce((state, key) => { |
||||||
|
if (mask[key] === true) { |
||||||
|
state[key] = object[key]; |
||||||
|
} else if (mask[key]) { |
||||||
|
state[key] = maskObject(object[key], mask[key]); |
||||||
|
} |
||||||
|
return state; |
||||||
|
}, {}); |
||||||
|
} |
Loading…
Reference in new issue