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

Function mapAlign

Source/Node/AlignNode.cpp:55–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55std::optional<YGAlign> mapAlign(std::string_view align) {
56 switch (Switch::hash(align)) {
57 case "flex-start"_hash: return YGAlignFlexStart;
58 case "center"_hash: return YGAlignCenter;
59 case "flex-end"_hash: return YGAlignFlexEnd;
60 case "stretch"_hash: return YGAlignStretch;
61 case "auto"_hash: return YGAlignAuto;
62 }
63 Warn("invalid CSS Align: \"{}\", should be one of \"flex-start\", \"center\", \"flex-end\", \"stretch\" and \"auto\"", align);
64 return std::nullopt;
65}
66
67std::optional<YGFlexDirection> mapFlexDirection(std::string_view flexDirection) {
68 switch (Switch::hash(flexDirection)) {

Callers 1

cssMethod · 0.85

Calls 2

hashFunction · 0.50
WarnFunction · 0.50

Tested by

no test coverage detected