mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Move the escapeString
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:
parent
e5859e145d
commit
9adc7859c8
6 changed files with 31 additions and 27 deletions
|
@ -17,7 +17,6 @@ import {
|
|||
bytesToString,
|
||||
createPromiseCapability,
|
||||
createValidAbsoluteUrl,
|
||||
escapeString,
|
||||
getModificationDate,
|
||||
isArrayBuffer,
|
||||
string32,
|
||||
|
@ -244,14 +243,6 @@ describe("util", function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe("escapeString", function () {
|
||||
it("should escape (, ), \\n, \\r, and \\", function () {
|
||||
expect(escapeString("((a\\a))\n(b(b\\b)\rb)")).toEqual(
|
||||
"\\(\\(a\\\\a\\)\\)\\n\\(b\\(b\\\\b\\)\\rb\\)"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getModificationDate", function () {
|
||||
it("should get a correctly formatted date", function () {
|
||||
const date = new Date(Date.UTC(3141, 5, 9, 2, 6, 53));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue