1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Rename the isSpace helper function to isWhiteSpace

Trying to enable the ESLint rule `no-shadow`, against the `master` branch, would result in a fair number of errors in the `Glyph` class in `src/core/fonts.js`.
Since the glyphs are exposed through the API, we can't very well change the `isSpace` property on `Glyph` instances. Thus the best approach seems, at least to me, to simply rename the `isSpace` helper function to `isWhiteSpace` which shouldn't cause any issues given that it's only used in the `src/core/` folder.
This commit is contained in:
Jonas Jenwald 2020-02-10 09:38:57 +01:00
parent e4758beaaa
commit c5f67300e9
8 changed files with 32 additions and 28 deletions

View file

@ -161,7 +161,7 @@ function readUint32(data, offset) {
}
// Checks if ch is one of the following characters: SPACE, TAB, CR or LF.
function isSpace(ch) {
function isWhiteSpace(ch) {
return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;
}
@ -176,5 +176,5 @@ export {
readInt8,
readUint16,
readUint32,
isSpace,
isWhiteSpace,
};