authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-22 16:43:49 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-01-22 16:54:55 -08:00
loga8eff70a99f05c0837b60b138c395b0f6d4000ff
treef28083a06a39671bedef76b1841397cb2d5afe20
parentcc06e6709bb5af14867d8cdd82daebbe7f4b22a8

populate port field


3 files changed, 4 insertions(+), 2 deletions(-)

generate.ts+1-1
...@@ -54,7 +54,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:...@@ -54,7 +54,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:
54 try expect(u.password).toEqualString(password);54 try expect(u.password).toEqualString(password);
55 _ = host;55 _ = host;
56 _ = hostname;56 _ = hostname;
57 _ = port;57 try expect(u.port).toEqualString(port);
58 _ = pathname;58 _ = pathname;
59 _ = search;59 _ = search;
60 _ = hash;60 _ = hash;
url.zig+2
...@@ -10,6 +10,7 @@ pub const URL = struct {...@@ -10,6 +10,7 @@ pub const URL = struct {
10 protocol: []const u8,10 protocol: []const u8,
11 username: []const u8,11 username: []const u8,
12 password: []const u8,12 password: []const u8,
13 port: []const u8,
1314
14 pub const HostKind = enum {15 pub const HostKind = enum {
15 name,16 name,
...@@ -783,6 +784,7 @@ pub const URL = struct {...@@ -783,6 +784,7 @@ pub const URL = struct {
783 .protocol = _href[0..extras.sum(usize, href.lengths[0..2])],784 .protocol = _href[0..extras.sum(usize, href.lengths[0..2])],
784 .username = _href[extras.sum(usize, href.lengths[0..2])..][0..href.lengths[3]],785 .username = _href[extras.sum(usize, href.lengths[0..2])..][0..href.lengths[3]],
785 .password = _href[extras.sum(usize, href.lengths[0..4])..][0..href.lengths[5]],786 .password = _href[extras.sum(usize, href.lengths[0..4])..][0..href.lengths[5]],
787 .port = _href[extras.sum(usize, href.lengths[0..8])..][0..href.lengths[9]],
786 };788 };
787 return url;789 return url;
788 }790 }
zig-out/test.zig+1-1
...@@ -24,7 +24,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:...@@ -24,7 +24,7 @@ pub fn parsePass(input: []const u8, base: ?[]const u8, href: []const u8, origin:
24 try expect(u.password).toEqualString(password);24 try expect(u.password).toEqualString(password);
25 _ = host;25 _ = host;
26 _ = hostname;26 _ = hostname;
27 _ = port;27 try expect(u.port).toEqualString(port);
28 _ = pathname;28 _ = pathname;
29 _ = search;29 _ = search;
30 _ = hash;30 _ = hash;