Skip to content
Open
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion injected/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@

/**
* @param {string} feature
* @param {Record<string, any>} message
* @param {Record<string, unknown>} message
* @param {boolean} [allowNonDebug]
*/
export function postDebugMessage(feature, message, allowNonDebug = false) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This becomes a type-check failure with the new Record<string, unknown> annotation. message.stack is unknown; inside if (message.stack), TypeScript narrows it to {}, which is not assignable to getStackTraceOrigins(stack: string | undefined). A narrow typedef for debug messages, e.g. Record<string, unknown> & { stack?: string; scriptOrigins?: string[] }, keeps the any removal without breaking npm run tsc.

Expand All @@ -589,7 +589,7 @@
return;
}
if (message.stack) {
const scriptOrigins = [...getStackTraceOrigins(message.stack)];

Check failure on line 592 in injected/src/utils.js

View workflow job for this annotation

GitHub Actions / unit (ubuntu-latest)

Argument of type '{}' is not assignable to parameter of type 'string'.
message.scriptOrigins = scriptOrigins;
}
globalObj.postMessage({
Expand Down
Loading