Skip to content
Snippets Groups Projects
Verified Commit a8f23fde authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

fix: check is value is a string

parent f2e1de1b
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@
*/
import { getWindow } from "./util.mjs";
import { validateString } from "../types/validate.mjs";
export { convertToPixels, getDeviceDPI };
......@@ -74,6 +75,10 @@ function getDeviceDPI() {
*/
function convertToPixels(value, parentElement = document.documentElement, fontSizeElement = document.documentElement) {
validateString(value);
const regex = /^(-?[\d.]+)(.*)$/;
const matchResult = value.match(regex);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment