Skip to content

Commit

Permalink
Cosmetic changes.
Browse files Browse the repository at this point in the history
Remove unnecessary parameter type, make type an array.
  • Loading branch information
SpacingBat3 committed Aug 25, 2024
1 parent d4d4c87 commit cda439c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sources/code/main/windows/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ export default function createMainWindow(...flags:MainWindowFlags): BrowserWindo
})
.reduce((previousValue,currentValue) => (previousValue??false) && (currentValue??false))??true;
};
type handlerParamType<H extends "request"|"check", T extends number> = Parameters<Exclude<Parameters<Electron.Session[`setPermission${Capitalize<H>}Handler`]>[0],null>>[T];
type handlerParamType<H extends "request"|"check"> = Parameters<Exclude<Parameters<Electron.Session[`setPermission${Capitalize<H>}Handler`]>[0],null>>;
/** Common handler for */
const permissionHandler = <T extends "request"|"check">(type:T,webContentsUrl:string, permission:string, details:handlerParamType<T,3>) => {
const permissionHandler = <T extends "request"|"check">(type:T,webContentsUrl:string, permission:string, details:handlerParamType<T>[3]) => {
// Verify URL address of the permissions.
try {
const webContents = new URL(webContentsUrl);
Expand Down

0 comments on commit cda439c

Please sign in to comment.