MCPcopy Create free account
hub / github.com/ptmt/react-native-macos / flattenStyle

Function flattenStyle

Libraries/StyleSheet/flattenStyle.js:26–46  ·  view source on GitHub ↗
(style: ?StyleObj)

Source from the content-addressed store, hash-verified

24}
25
26function flattenStyle(style: ?StyleObj): ?Object {
27 if (!style) {
28 return undefined;
29 }
30 invariant(style !== true, 'style may be false but not true');
31
32 if (!Array.isArray(style)) {
33 return getStyle(style);
34 }
35
36 var result = {};
37 for (var i = 0, styleLength = style.length; i < styleLength; ++i) {
38 var computedStyle = flattenStyle(style[i]);
39 if (computedStyle) {
40 for (var key in computedStyle) {
41 result[key] = computedStyle[key];
42 }
43 }
44 }
45 return result;
46}
47
48module.exports = flattenStyle;

Callers 10

diffNestedPropertyFunction · 0.85
constructorMethod · 0.85
ScrollView.jsFile · 0.85
Image.android.jsFile · 0.85
Image.macos.jsFile · 0.85
StyleSheetPropTypeFunction · 0.85
ElementBox.jsFile · 0.85

Calls 2

invariantFunction · 0.85
getStyleFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…