feat(data-structures): add is_empty
getter to map, string and blob.
This commit is contained in:
@@ -25,7 +25,11 @@ mod map_functions {
|
||||
pub fn len(map: &mut Map) -> INT {
|
||||
map.len() as INT
|
||||
}
|
||||
|
||||
/// Return true if the map is empty.
|
||||
#[rhai_fn(name = "is_empty", get = "is_empty", pure)]
|
||||
pub fn is_empty(map: &mut Map) -> bool {
|
||||
map.len() == 0
|
||||
}
|
||||
/// Get the value of the `property` in the object map and return a copy.
|
||||
///
|
||||
/// If `property` does not exist in the object map, `()` is returned.
|
||||
|
Reference in New Issue
Block a user