Most of the code & API changes necessary for supporting Relay (GraphQL)

This commit is contained in:
Jarred Sumner
2021-09-29 23:28:54 -07:00
parent 5dac4e6108
commit 74db7809eb
5 changed files with 497 additions and 14 deletions

View File

@@ -110,6 +110,10 @@ pub const ZigString = extern struct {
return this.ptr[0..std.math.min(this.len, 4096)];
}
pub fn trimmedSlice(this: *const ZigString) []const u8 {
return std.mem.trim(u8, this.ptr[0..std.math.min(this.len, 4096)], " \r\n");
}
pub fn toValue(this: ZigString, global: *JSGlobalObject) JSValue {
return shim.cppFn("toValue", .{ this, global });
}