summaryrefslogtreecommitdiff
path: root/src/model/methods.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/methods.rs')
-rw-r--r--src/model/methods.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/model/methods.rs b/src/model/methods.rs
index c0b63669..38ebebda 100644
--- a/src/model/methods.rs
+++ b/src/model/methods.rs
@@ -37,6 +37,8 @@ pub fn call(
}
Value::Str(string.slice(start, end).at(span)?)
}
+ "clusters" => Value::Array(string.clusters()),
+ "codepoints" => Value::Array(string.codepoints()),
"contains" => Value::Bool(string.contains(args.expect("pattern")?)),
"starts-with" => Value::Bool(string.starts_with(args.expect("pattern")?)),
"ends-with" => Value::Bool(string.ends_with(args.expect("pattern")?)),
@@ -218,6 +220,8 @@ pub fn methods_on(type_name: &str) -> &[(&'static str, bool)] {
"string" => &[
("len", false),
("at", true),
+ ("clusters", false),
+ ("codepoints", false),
("contains", true),
("ends-with", true),
("find", true),