feat(data-structures): add is_empty getter to map, string and blob.

This commit is contained in:
ltabis
2022-08-24 09:54:41 +02:00
parent 9c3443538a
commit 4b3608cedc
6 changed files with 41 additions and 3 deletions

View File

@@ -31,8 +31,8 @@ pub mod array_functions {
array.len() as INT
}
/// Return true if the array is empty.
#[rhai_fn(name = "empty", get = "empty", pure)]
pub fn empty(array: &mut Array) -> bool {
#[rhai_fn(name = "is_empty", get = "is_empty", pure)]
pub fn is_empty(array: &mut Array) -> bool {
array.len() == 0
}
/// Get a copy of the element at the `index` position in the array.