aboutsummaryrefslogtreecommitdiff
path: root/src/string_immutable.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2023-01-07 07:09:48 -0800
committerGravatar GitHub <noreply@github.com> 2023-01-07 07:09:48 -0800
commit87983464d8a331c1ddd09eced9920269a759f0a9 (patch)
treeb08a5aef5c2d18f25a5ee46c88bec84d5b8ee907 /src/string_immutable.zig
parentd5565ab2cdd7099a5852ba5ba6d180ef291af084 (diff)
downloadbun-87983464d8a331c1ddd09eced9920269a759f0a9.tar.gz
bun-87983464d8a331c1ddd09eced9920269a759f0a9.tar.zst
bun-87983464d8a331c1ddd09eced9920269a759f0a9.zip
Implement DNS module (#1691)
* Boilerplate for DNS stuff * Add c-ares * lookup * make * Implement dns.lookup * Create c-ares * wip * normalize * repro * Revert "repro" This reverts commit 8b93e0c295b335b8882a9601da47720348549beb. * Implement macOS `getaddrinfo_async_start` * embiggen * Update string_immutable.zig * Update Makefile * alright * Update .gitignore * Add types * more ccache * Update Dockerfile * Update Dockerfile * Update Dockerfile * Update bun.d.ts Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/string_immutable.zig')
-rw-r--r--src/string_immutable.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/string_immutable.zig b/src/string_immutable.zig
index 7c2b61c03..29b692ffb 100644
--- a/src/string_immutable.zig
+++ b/src/string_immutable.zig
@@ -3974,6 +3974,14 @@ pub fn isIPAddress(input: []const u8) bool {
}
}
+pub fn isIPV6Address(input: []const u8) bool {
+ if (std.net.Address.parseIp6(input, 0)) |_| {
+ return true;
+ } else |_| {
+ return false;
+ }
+}
+
pub fn cloneNormalizingSeparators(
allocator: std.mem.Allocator,
input: []const u8,