mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 23:31:02 +02:00
Shorten the isAscii helper function a tiny bit
This commit is contained in:
parent
153cef615e
commit
7a7e7049c1
@ -16,10 +16,7 @@
|
||||
import { Util } from "../shared/util.js";
|
||||
|
||||
function isAscii(str) {
|
||||
if (typeof str !== "string") {
|
||||
return false;
|
||||
}
|
||||
return !str || /^[\x00-\x7F]*$/.test(str);
|
||||
return typeof str === "string" && (!str || /^[\x00-\x7F]*$/.test(str));
|
||||
}
|
||||
|
||||
// If the string is null or undefined then it is returned as is.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user