UNPKG

igniteui-react-core

Version:
31 lines (30 loc) 1.14 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { typeCast } from "./type"; import { Size } from "./Size"; export function isSize(s) { if (s == null) return false; if (typeCast(Size.$t, s) != null) return true; if (typeof s.width === "number" && typeof s.height === "number") return true; return false; } export function sizeFromLiteral(s) { if (s == null) return new Size(1, 0, 0); var cast = typeCast(Size.$t, s); if (cast != null) return cast; return new Size(1, s.width, s.height); } export function sizeToLiteral(s) { if (s == null) return null; return { width: s.width, height: s.height }; }