Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions packages/utils/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,12 @@ function _htmlElementAsString(el: unknown, keyAttrs?: string[]): string {
out.push(elem.tagName.toLowerCase());

// Pairs of attribute keys defined in `serializeAttribute` and their values on element.
const keyAttrPairs = keyAttrs?.length
? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
: null;
const keyAttrPairs =
keyAttrs && keyAttrs.length
? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])
: null;

if (keyAttrPairs?.length) {
if (keyAttrPairs && keyAttrPairs.length) {
keyAttrPairs.forEach(keyAttrPair => {
out.push(`[${keyAttrPair[0]}="${keyAttrPair[1]}"]`);
});
Expand Down
4 changes: 2 additions & 2 deletions packages/utils/src/misc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function addExceptionMechanism(event: Event, newMechanism?: Partial<Mecha
exceptionValue0.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };

if (newMechanism && 'data' in newMechanism) {
const mergedData = { ...currentMechanism?.data, ...newMechanism.data };
const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };
exceptionValue0.mechanism.data = mergedData;
}
}
Expand Down Expand Up @@ -261,7 +261,7 @@ export function stripUrlQueryAndFragment(urlPath: string): string {
*/
export function checkOrSetAlreadyCaught(exception: unknown): boolean {
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
if ((exception as any)?.__sentry_captured__) {
if (exception && (exception as any).__sentry_captured__) {
return true;
}

Expand Down