Remove the isString helper function

The call-sites are replaced by direct `typeof`-checks instead, which removes unnecessary function calls. Note that in the `src/`-folder we already had more `typeof`-cases than `isString`-calls.
This commit is contained in:
Jonas Jenwald 2022-02-23 17:02:19 +01:00
parent 6bd4e0f5af
commit 99cd24ce3e
9 changed files with 47 additions and 75 deletions

View file

@ -19,13 +19,7 @@ import {
BaseStandardFontDataFactory,
BaseSVGFactory,
} from "./base_factory.js";
import {
BaseException,
isString,
stringToBytes,
Util,
warn,
} from "../shared/util.js";
import { BaseException, stringToBytes, Util, warn } from "../shared/util.js";
const SVG_NS = "http://www.w3.org/2000/svg";
@ -482,7 +476,7 @@ class PDFDateString {
* @returns {Date|null}
*/
static toDateObject(input) {
if (!input || !isString(input)) {
if (!input || typeof input !== "string") {
return null;
}