1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge pull request #14598 from Snuffleupagus/rm-isBool

Re-factor the `Catalog.viewerPreferences` method and remove the `isBool` helper function
This commit is contained in:
Tim van der Meij 2022-02-23 20:36:56 +01:00 committed by GitHub
commit 2bb96a708c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 68 additions and 104 deletions

View file

@ -21,7 +21,6 @@ import {
getModificationDate,
isArrayBuffer,
isAscii,
isBool,
isSameOrigin,
isString,
string32,
@ -74,22 +73,6 @@ describe("util", function () {
});
});
describe("isBool", function () {
it("handles boolean values", function () {
expect(isBool(true)).toEqual(true);
expect(isBool(false)).toEqual(true);
});
it("handles non-boolean values", function () {
expect(isBool("true")).toEqual(false);
expect(isBool("false")).toEqual(false);
expect(isBool(1)).toEqual(false);
expect(isBool(0)).toEqual(false);
expect(isBool(null)).toEqual(false);
expect(isBool(undefined)).toEqual(false);
});
});
describe("isString", function () {
it("handles string values", function () {
expect(isString("foo")).toEqual(true);