This commit is contained in:
Jarred Sumner
2021-04-22 19:29:32 -07:00
parent 92c6de6d8b
commit 5ef6df40f3
6 changed files with 788 additions and 31 deletions

View File

@@ -1,6 +1,8 @@
const std = @import("std");
const expect = std.testing.expect;
const JavascriptString = @import("ast/base.zig").JavascriptString;
usingnamespace @import("string_types.zig");
pub fn containsChar(self: string, char: u8) bool {
@@ -34,3 +36,7 @@ pub fn index(self: string, str: string) i32 {
return -1;
}
}
pub fn eqlUtf16(comptime self: string, other: JavascriptString) bool {
return std.mem.eql(u16, std.unicode.utf8ToUtf16LeStringLiteral(self), other);
}