mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Remove the isArrayBuffer
helper function
This old helper function can now be replaced with `ArrayBuffer.isView()` and/or `instanceof ArrayBuffer` checks, as needed depending on the situation.
This commit is contained in:
parent
a0e2b62245
commit
b37536c38c
4 changed files with 10 additions and 35 deletions
|
@ -17,7 +17,6 @@ import {
|
|||
bytesToString,
|
||||
createValidAbsoluteUrl,
|
||||
getModificationDate,
|
||||
isArrayBuffer,
|
||||
PromiseCapability,
|
||||
string32,
|
||||
stringToBytes,
|
||||
|
@ -53,20 +52,6 @@ describe("util", function () {
|
|||
});
|
||||
});
|
||||
|
||||
describe("isArrayBuffer", function () {
|
||||
it("handles array buffer values", function () {
|
||||
expect(isArrayBuffer(new ArrayBuffer(0))).toEqual(true);
|
||||
expect(isArrayBuffer(new Uint8Array(0))).toEqual(true);
|
||||
});
|
||||
|
||||
it("handles non-array buffer values", function () {
|
||||
expect(isArrayBuffer("true")).toEqual(false);
|
||||
expect(isArrayBuffer(1)).toEqual(false);
|
||||
expect(isArrayBuffer(null)).toEqual(false);
|
||||
expect(isArrayBuffer(undefined)).toEqual(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("string32", function () {
|
||||
it("converts unsigned 32-bit integers to strings", function () {
|
||||
expect(string32(0x74727565)).toEqual("true");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue