MCPcopy Create free account
hub / github.com/streamlit/streamlit / validate_emoji

Function validate_emoji

lib/streamlit/string_util.py:81–90  ·  view source on GitHub ↗
(maybe_emoji: str | None)

Source from the content-addressed store, hash-verified

79
80
81def validate_emoji(maybe_emoji: str | None) -> str:
82 if maybe_emoji is None:
83 return ""
84
85 if is_emoji(maybe_emoji):
86 return maybe_emoji
87 raise StreamlitAPIException(
88 f'The value "{maybe_emoji}" is not a valid emoji. Shortcodes are not allowed, '
89 "please use a single character instead."
90 )
91
92
93def validate_material_icon(maybe_material_icon: str | None) -> str:

Callers 1

validate_icon_or_emojiFunction · 0.85

Calls 2

is_emojiFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…