Sha256: 5eb89521342c6d53815de6da334c759b5d8ee48655519befc4db853cbd0f6f83
Contents?: true
Size: 821 Bytes
Versions: 51
Compression:
Stored size: 821 Bytes
Contents
import { isNumeric } from "@helpers/lang"; function getHiddenElementDimensions(el, display = "block") { let size; if (el.style.display === "none") { el.style.display = display; size = el.getBoundingClientRect(); el.style.display = "none"; } else { size = el.getBoundingClientRect(); } return size; } function castAttributeValue(value) { if (value === "false") { return false; } if (value === "true") { return true; } if (isNumeric(value)) { return parseInt(value, 10); } return value; } function isNode(o) { return typeof Node === "object" ? o instanceof Node : o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName === "string"; } export { getHiddenElementDimensions, castAttributeValue, isNode };
Version data entries
51 entries across 51 versions & 1 rubygems