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

Function nativeScriptTabItems

packages/nativescript-inspector/src/index.ts:1447–1484  ·  view source on GitHub ↗
(
  tabView: View,
  nativeScriptChildrenNodes: JSONObject[] = [],
  sourceRoot = "",
)

Source from the content-addressed store, hash-verified

1445}
1446
1447function nativeScriptTabItems(
1448 tabView: View,
1449 nativeScriptChildrenNodes: JSONObject[] = [],
1450 sourceRoot = "",
1451): JSONObject[] {
1452 const rawItems = nsArray(
1453 read(tabView, "items") ||
1454 read(tabView, "_items") ||
1455 read(tabView, "_tabItems"),
1456 );
1457 const children = nativeScriptChildren(tabView);
1458 const count = Math.max(
1459 rawItems.length,
1460 children.length,
1461 nativeScriptChildrenNodes.length,
1462 );
1463 return Array.from({ length: count }, (_, index) => {
1464 const child = children[index] ?? null;
1465 const childNode = nativeScriptChildrenNodes[index] ?? {};
1466 const item =
1467 rawItems[index] ||
1468 read(child, "tabItem") ||
1469 read(child, "_tabItem") ||
1470 {};
1471 return {
1472 title:
1473 stringValue(read(item, "title")) || stringValue(read(child, "title")),
1474 iconSource:
1475 stringValue(read(item, "iconSource")) ||
1476 stringValue(read(child, "iconSource")),
1477 view: read(item, "view") || child,
1478 sourceLocation:
1479 sourceLocationForView(item, sourceRoot) ||
1480 sourceLocationForView(child, sourceRoot) ||
1481 sourceLocationFromNode(childNode),
1482 };
1483 });
1484}
1485
1486function tabItemSourceLocation(
1487 tabView: View,

Callers 2

Calls 8

nsArrayFunction · 0.85
readFunction · 0.85
nativeScriptChildrenFunction · 0.85
stringValueFunction · 0.85
sourceLocationForViewFunction · 0.85
sourceLocationFromNodeFunction · 0.85
maxMethod · 0.80
fromMethod · 0.80

Tested by

no test coverage detected