mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Enable the ESLint prefer-const
rule in the web/
directory
Please find additional details about the ESLint rule at https://eslint.org/docs/rules/prefer-const Note that this patch is generated automatically, by using the ESLint `--fix` argument, and will thus require some additional clean-up (which is done separately).
This commit is contained in:
parent
9c767e3875
commit
5d14e68bec
36 changed files with 367 additions and 367 deletions
|
@ -102,7 +102,7 @@ class PDFDocumentProperties {
|
|||
* Open the document properties overlay.
|
||||
*/
|
||||
open() {
|
||||
let freezeFieldData = data => {
|
||||
const freezeFieldData = data => {
|
||||
Object.defineProperty(this, "fieldData", {
|
||||
value: Object.freeze(data),
|
||||
writable: false,
|
||||
|
@ -193,7 +193,7 @@ class PDFDocumentProperties {
|
|||
if (fileSize === this.fieldData["fileSize"]) {
|
||||
return; // The fileSize has already been correctly set.
|
||||
}
|
||||
let data = Object.assign(Object.create(null), this.fieldData);
|
||||
const data = Object.assign(Object.create(null), this.fieldData);
|
||||
data["fileSize"] = fileSize;
|
||||
|
||||
freezeFieldData(data);
|
||||
|
@ -267,7 +267,7 @@ class PDFDocumentProperties {
|
|||
*/
|
||||
_updateUI(reset = false) {
|
||||
if (reset || !this.fieldData) {
|
||||
for (let id in this.fields) {
|
||||
for (const id in this.fields) {
|
||||
this.fields[id].textContent = DEFAULT_FIELD_CONTENT;
|
||||
}
|
||||
return;
|
||||
|
@ -277,8 +277,8 @@ class PDFDocumentProperties {
|
|||
// since it will be updated the next time `this.open` is called.
|
||||
return;
|
||||
}
|
||||
for (let id in this.fields) {
|
||||
let content = this.fieldData[id];
|
||||
for (const id in this.fields) {
|
||||
const content = this.fieldData[id];
|
||||
this.fields[id].textContent =
|
||||
content || content === 0 ? content : DEFAULT_FIELD_CONTENT;
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ class PDFDocumentProperties {
|
|||
* @private
|
||||
*/
|
||||
async _parseFileSize(fileSize = 0) {
|
||||
let kb = fileSize / 1024;
|
||||
const kb = fileSize / 1024;
|
||||
if (!kb) {
|
||||
return undefined;
|
||||
} else if (kb < 1024) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue