Enable TS strict mode and fix all associated errors

This commit is contained in:
William Oldham
2024-03-15 18:49:12 +00:00
parent a884c785f0
commit 8ba0544468
9 changed files with 28 additions and 21 deletions

View File

@@ -15,12 +15,15 @@ interface Request extends BaseRequest {
const handler: PlasmoMessaging.MessageHandler<Request, BaseResponse> = async (req, res) => {
try {
if (!req.sender?.tab?.url) throw new Error('No tab URL found in the request.');
if (!req.body) throw new Error('No request body found in the request.');
await assertDomainWhitelist(req.sender.tab.url);
await setDynamicRules(req.body);
res.send({
success: true,
});
} catch (err) {
} catch (err: any) {
res.send({
success: false,
error: err.message,