feat(data-structures): add is_empty
getter to map, string and blob.
This commit is contained in:
@@ -140,6 +140,11 @@ pub mod blob_functions {
|
||||
pub fn len(blob: &mut Blob) -> INT {
|
||||
blob.len() as INT
|
||||
}
|
||||
/// Return true if the blob is empty.
|
||||
#[rhai_fn(name = "is_empty", get = "is_empty", pure)]
|
||||
pub fn is_empty(blob: &mut Blob) -> bool {
|
||||
blob.len() == 0
|
||||
}
|
||||
/// Get the byte value at the `index` position in the BLOB.
|
||||
///
|
||||
/// * If `index` < 0, position counts from the end of the BLOB (`-1` is the last element).
|
||||
|
Reference in New Issue
Block a user