about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-26 19:46:06 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-26 19:46:30 +0100
commit9c78cc3ce8b3345f95cb37a2a9d2101f52ecaa41 (patch)
tree335d76935ee1b52448946abc9d4553fd8b6c0bf8 /src/types
parent774aad55da0fc62f8de8c95dbbb3d2ad41010e3f (diff)
downloadchawan-9c78cc3ce8b3345f95cb37a2a9d2101f52ecaa41.tar.gz
Consistent naming of parseURL, non-public newURLParams
Diffstat (limited to 'src/types')
-rw-r--r--src/types/url.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index 4dbe24c7..69df47c3 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -731,7 +731,7 @@ func anchor*(url: Url): string =
     return url.fragment.get
   return ""
 
-proc parseUrl*(input: string, base = none(Url), url: var Url, override = none(UrlState)): Option[Url] =
+proc parseURL*(input: string, base = none(Url), url: var Url, override = none(UrlState)): Option[Url] =
   var url = basicParseUrl(input, base, url, override)
   if url.isnone:
     return url
@@ -740,7 +740,7 @@ proc parseUrl*(input: string, base = none(Url), url: var Url, override = none(Ur
   url.get.blob = BlobUrlEntry().some
   return url
 
-proc parseUrl*(input: string, base = none(Url), override = none(UrlState)): Option[Url] =
+proc parseURL*(input: string, base = none(Url), override = none(UrlState)): Option[Url] =
   var url = Url().some
   url = basicParseUrl(input, base, url.get, override)
   if url.isnone:
@@ -901,7 +901,7 @@ proc serializeApplicationXWWWFormUrlEncoded*(kvs: seq[(string, string)]): string
 proc initURLSearchParams(params: URLSearchParams, init: string) =
   params.list = parseApplicationXWWWFormUrlEncoded(init)
 
-proc newURLSearchParams*[T: seq[(string, string)]|Table[string, string]|string](init: T = ""): URLSearchParams {.jsctor.} =
+proc newURLSearchParams[T: seq[(string, string)]|Table[string, string]|string](init: T = ""): URLSearchParams {.jsctor.} =
   new(result)
   when T is seq[(string, string)]:
     result.list = init
@@ -965,14 +965,14 @@ proc newURL*(url: URL): URL =
 #TODO add Option wrapper
 proc newURL*(s: string, base: Option[string] = none(string)): URL {.jserr, jsctor.} =
   if base.issome:
-    let baseUrl = parseUrl(base.get)
+    let baseUrl = parseURL(base.get)
     if baseUrl.isnone:
       JS_ERR JS_TypeError, base.get & " is not a valid URL"
-    let url = parseUrl(s, baseUrl)
+    let url = parseURL(s, baseUrl)
     if url.isnone:
       JS_ERR JS_TypeError, s & " is not a valid URL"
     return url.get
-  let url = parseUrl(s)
+  let url = parseURL(s)
   if url.isnone:
     JS_ERR JS_TypeError, s & " is not a valid URL"
   url.get.searchParams = newURLSearchParams()