mod coercion;
mod conversion;
mod lookup;
mod strings;
mod traversal;
#[cfg(feature = "datetime")]
pub(crate) use coercion::coerce_to_number;
pub(crate) use coercion::{coerce_to_number_cfg, try_coerce_to_integer_cfg};
#[cfg(feature = "serde_json")]
pub use conversion::data_to_value;
#[cfg(feature = "serde_json")]
pub use conversion::value_to_data;
pub(crate) use lookup::object_lookup_field;
pub(crate) use strings::{data_to_str, truthy_arena};
pub(crate) use traversal::apply_path_element;
pub(crate) use traversal::{
access_path_str_ref, path_exists_segments, path_exists_str, traverse_segments,
};
pub use datavalue::DataValue;
#[inline]
pub(crate) fn truthy_js_arena(v: &DataValue<'_>) -> bool {
match v {
DataValue::Null => false,
DataValue::Bool(b) => *b,
DataValue::Number(n) => !n.is_zero() && !n.is_nan(),
DataValue::String(s) => !s.is_empty(),
DataValue::Array(items) => !items.is_empty(),
DataValue::Object(pairs) => !pairs.is_empty(),
#[cfg(feature = "datetime")]
DataValue::DateTime(_) | DataValue::Duration(_) => true,
}
}