aboutsummaryrefslogtreecommitdiff
path: root/src/string_joiner.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/string_joiner.zig')
-rw-r--r--src/string_joiner.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/string_joiner.zig b/src/string_joiner.zig
index 884dce2ef..7896743cb 100644
--- a/src/string_joiner.zig
+++ b/src/string_joiner.zig
@@ -115,3 +115,13 @@ pub fn append(this: *Joiner, slice: string, offset: u32, allocator: ?Allocator)
tail.next = new_tail;
this.tail = new_tail;
}
+
+pub fn contains(this: *const Joiner, slice: string) bool {
+ var el = this.head;
+ while (el) |node| {
+ el = node.next;
+ if (bun.strings.contains(node.data.slice[node.data.offset..], slice)) return true;
+ }
+
+ return false;
+}