Skip to main content

jss_core/schema/value/
mod.rs

1use super::*;
2
3impl JssValue {
4    pub fn string(s: impl Into<String>) -> Self {
5        Self::String(s.into())
6    }
7}
8
9impl JssValue {
10    pub fn is_empty(&self) -> bool {
11        match self {
12            JssValue::String(s) => s.is_empty(),
13            JssValue::Url(s) => s.is_empty(),
14            JssValue::Regex(s) => s.is_empty(),
15            JssValue::Array(s) => s.is_empty(),
16            JssValue::Object(s) => s.is_empty(),
17            _ => false,
18        }
19    }
20}