mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Enable the unicorn/prefer-logical-operator-over-ternary
ESLint plugin rule
This leads to ever so slightly more compact code, and can in some cases remove the need for a temporary variable. Please find additional information here: https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-logical-operator-over-ternary.md
This commit is contained in:
parent
aa6512e70f
commit
dcc73423e5
5 changed files with 13 additions and 15 deletions
|
@ -1267,7 +1267,7 @@ class Font {
|
|||
|
||||
// Read the table associated data
|
||||
const previousPosition = file.pos;
|
||||
file.pos = file.start ? file.start : 0;
|
||||
file.pos = file.start || 0;
|
||||
file.skip(offset);
|
||||
const data = file.getBytes(length);
|
||||
file.pos = previousPosition;
|
||||
|
@ -1405,7 +1405,7 @@ class Font {
|
|||
};
|
||||
}
|
||||
let segment;
|
||||
let start = (file.start ? file.start : 0) + cmap.offset;
|
||||
let start = (file.start || 0) + cmap.offset;
|
||||
file.pos = start;
|
||||
|
||||
file.skip(2); // version
|
||||
|
@ -1717,7 +1717,7 @@ class Font {
|
|||
return;
|
||||
}
|
||||
|
||||
file.pos = (file.start ? file.start : 0) + header.offset;
|
||||
file.pos = (file.start || 0) + header.offset;
|
||||
file.pos += 4; // version
|
||||
file.pos += 2; // ascent
|
||||
file.pos += 2; // descent
|
||||
|
@ -2081,7 +2081,7 @@ class Font {
|
|||
}
|
||||
|
||||
function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) {
|
||||
const start = (font.start ? font.start : 0) + post.offset;
|
||||
const start = (font.start || 0) + post.offset;
|
||||
font.pos = start;
|
||||
|
||||
const length = post.length,
|
||||
|
@ -2151,7 +2151,7 @@ class Font {
|
|||
}
|
||||
|
||||
function readNameTable(nameTable) {
|
||||
const start = (font.start ? font.start : 0) + nameTable.offset;
|
||||
const start = (font.start || 0) + nameTable.offset;
|
||||
font.pos = start;
|
||||
|
||||
const names = [[], []];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue