1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Move the isAscii helper function into the worker-thread

Given that this helper function is only used on the worker-thread, there's no reason to duplicate it in both of the `pdf.js` and `pdf.worker.js` files.
This commit is contained in:
Jonas Jenwald 2022-11-16 12:07:24 +01:00
parent 2eaa708e3a
commit e5859e145d
5 changed files with 17 additions and 17 deletions

View file

@ -572,6 +572,10 @@ function getNewAnnotationsMap(annotationStorage) {
return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;
}
function isAscii(str) {
return /^[\x00-\x7F]*$/.test(str);
}
function stringToUTF16HexString(str) {
const buf = [];
for (let i = 0, ii = str.length; i < ii; i++) {
@ -622,6 +626,7 @@ export {
getLookupTableFactory,
getNewAnnotationsMap,
getRotationMatrix,
isAscii,
isWhiteSpace,
log2,
MissingDataException,