MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / rectValue

Function rectValue

packages/nativescript-inspector/src/index.ts:2011–2028  ·  view source on GitHub ↗
(rect: any)

Source from the content-addressed store, hash-verified

2009}
2010
2011function rectValue(rect: any): JSONObject | null {
2012 if (!rect) {
2013 return null;
2014 }
2015 const x = finiteNumber(rect.origin?.x ?? rect.x);
2016 const y = finiteNumber(rect.origin?.y ?? rect.y);
2017 const width = finiteNumber(rect.size?.width ?? rect.width);
2018 const height = finiteNumber(rect.size?.height ?? rect.height);
2019 if (x == null || y == null || width == null || height == null) {
2020 return null;
2021 }
2022 return {
2023 x,
2024 y,
2025 width,
2026 height,
2027 };
2028}
2029
2030function pointValue(point: any): JSONObject | null {
2031 if (!point) {

Callers 5

infoMethod · 0.85
uikitNodeMethod · 0.85
fallbackTabBarFrameFunction · 0.85
frameInScreenFunction · 0.85
encodeValueFunction · 0.85

Calls 1

finiteNumberFunction · 0.70

Tested by

no test coverage detected