refactor: use "as const" for constant mappings (#28980)

This commit is contained in:
Milan Burda 2021-05-04 23:12:49 +02:00 committed by GitHub
parent a699dfdf83
commit 961b74b2ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 11 deletions

View file

@ -60,7 +60,7 @@ const PDFPageSizes: Record<string, ElectronInternal.MediaSize> = {
width_microns: 279400,
custom_display_name: 'Tabloid'
}
};
} as const;
// The minimum micron size Chromium accepts is that where:
// Per printing/units.h:
@ -109,7 +109,7 @@ const defaultPrintingSetting = {
printerType: 2,
title: undefined as string | undefined,
url: undefined as string | undefined
};
} as const;
// JavaScript implementations of WebContents.
const binding = process._linkedBinding('electron_browser_web_contents');
@ -191,7 +191,7 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (worldId
let pendingPromise: Promise<any> | undefined;
WebContents.prototype.printToPDF = async function (options) {
const printSettings = {
const printSettings: Record<string, any> = {
...defaultPrintingSetting,
requestID: getNextId()
};