MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / mapJustifyContent

Function mapJustifyContent

Source/Node/AlignNode.cpp:78–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78std::optional<YGJustify> mapJustifyContent(std::string_view justifyContent) {
79 switch (Switch::hash(justifyContent)) {
80 case "flex-start"_hash: return YGJustifyFlexStart;
81 case "center"_hash: return YGJustifyCenter;
82 case "flex-end"_hash: return YGJustifyFlexEnd;
83 case "space-between"_hash: return YGJustifySpaceBetween;
84 case "space-around"_hash: return YGJustifySpaceAround;
85 case "space-evenly"_hash: return YGJustifySpaceEvenly;
86 }
87 Warn("invalid CSS JustifyContent: \"{}\", should be one of \"flex-start\", \"center\", \"flex-end\", \"space-between\", \"space-around\" and \"space-evenly\"", justifyContent);
88 return std::nullopt;
89}
90
91std::optional<YGPositionType> mapPositionType(std::string_view positionType) {
92 switch (Switch::hash(positionType)) {

Callers 1

cssMethod · 0.85

Calls 2

hashFunction · 0.50
WarnFunction · 0.50

Tested by

no test coverage detected