MCPcopy Index your code
hub / github.com/facebook/react / crawlData

Function crawlData

packages/react-devtools-shared/src/backend/StyleX/utils.js:27–55  ·  view source on GitHub ↗
(
  data: any,
  sources: Set<string>,
  resolvedStyles: Object,
)

Source from the content-addressed store, hash-verified

25}
26
27export function crawlData(
28 data: any,
29 sources: Set<string>,
30 resolvedStyles: Object,
31): void {
32 if (data == null) {
33 return;
34 }
35
36 if (isArray(data)) {
37 data.forEach(entry => {
38 if (entry == null) {
39 return;
40 }
41
42 if (isArray(entry)) {
43 crawlData(entry, sources, resolvedStyles);
44 } else {
45 crawlObjectProperties(entry, sources, resolvedStyles);
46 }
47 });
48 } else {
49 crawlObjectProperties(data, sources, resolvedStyles);
50 }
51
52 resolvedStyles = Object.fromEntries<string, any>(
53 Object.entries(resolvedStyles).sort(),
54 );
55}
56
57function crawlObjectProperties(
58 entry: Object,

Callers 2

getStyleXDataFunction · 0.85
crawlObjectPropertiesFunction · 0.85

Calls 4

isArrayFunction · 0.85
crawlObjectPropertiesFunction · 0.85
entriesMethod · 0.80
forEachMethod · 0.65

Tested by

no test coverage detected