Move blob functions to builtin.

This commit is contained in:
Stephen Chung
2021-12-18 14:58:02 +08:00
parent 2b79a65454
commit 9cf8360616
3 changed files with 24 additions and 28 deletions

View File

@@ -17,14 +17,6 @@ def_package!(crate:BasicMapPackage:"Basic object map utilities.", lib, {
#[export_module]
mod map_functions {
#[rhai_fn(name = "has", pure)]
pub fn contains(map: &mut Map, prop: ImmutableString) -> bool {
if map.is_empty() {
false
} else {
map.contains_key(prop.as_str())
}
}
#[rhai_fn(pure)]
pub fn len(map: &mut Map) -> INT {
map.len() as INT