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

@ -20,7 +20,6 @@ import {
escapeString,
getModificationDate,
isArrayBuffer,
isAscii,
string32,
stringToBytes,
stringToPDFString,
@ -259,14 +258,4 @@ describe("util", function () {
expect(getModificationDate(date)).toEqual("31410609020653");
});
});
describe("isAscii", function () {
it("handles ascii/non-ascii strings", function () {
expect(isAscii("hello world")).toEqual(true);
expect(isAscii("こんにちは世界の")).toEqual(false);
expect(isAscii("hello world in Japanese is こんにちは世界の")).toEqual(
false
);
});
});
});