Skip to content

kast-lang/uri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URI

A URI parser in Kast.

Usage

const uri = include "src/lib.ks";

with uri.ctx = {
    .warn = msg => std.io.eprint(msg),
};
let uri :: uri.Uri = String.parse("https://example.com:8080/path?query=value#fragment");

uri |> dbg.print;
# {
#   .scheme = "https",
#   .authority = "example.com:8080",
#   .path = "/path",
#   .query = "query=value",
#   .fragment = "fragment",
# }

String.to_string(uri) |> std.io.print;
# https://example.com:8080/path?query=value#fragment

Test

$ kast run tests/test.ks
all tests passed
# tests don't work on JS target because `==` doesn't perform structural equality

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors