ALPHA. This namespace's API is subject to change.
Default URLCodec implementation using transit+base64 encoding.
URL shape: /Seg1/Seg2?_p=<base64-encoded-transit>.
ALPHA. This namespace's API is subject to change. Default URLCodec implementation using transit+base64 encoding. URL shape: `/Seg1/Seg2?_p=<base64-encoded-transit>`.
(add-prefix prefix path)Prepends prefix to path. Returns path unchanged when prefix is "/".
Prepends `prefix` to `path`. Returns `path` unchanged when `prefix` is `"/"`.
(decode-params-base64 encoded)Decode a base64->transit param string back into a CLJ(S) map. Expects raw base64 input (not URI-encoded). Returns nil on nil/empty input or decode failure.
Decode a base64->transit param string back into a CLJ(S) map. Expects raw base64 input (not URI-encoded). Returns nil on nil/empty input or decode failure.
(encode-params-base64 params)Encode a CLJ(S) map as transit->base64. Returns raw base64 (no URI encoding).
The caller is responsible for URI-encoding if the result will be placed in a URL.
Returns nil if params is nil or empty.
Encode a CLJ(S) map as transit->base64. Returns raw base64 (no URI encoding). The caller is responsible for URI-encoding if the result will be placed in a URL. Returns nil if `params` is nil or empty.
(normalize-prefix prefix)Normalizes a URL path prefix so it starts with / and does not end with /.
Returns "/" for nil, empty, or root-only input.
Normalizes a URL path `prefix` so it starts with `/` and does not end with `/`. Returns `"/"` for nil, empty, or root-only input.
(strip-prefix prefix path)Removes prefix from the front of path. Returns path unchanged when prefix
is "/" or path does not start with prefix.
Removes `prefix` from the front of `path`. Returns `path` unchanged when `prefix` is `"/"` or `path` does not start with `prefix`.
(transit-base64-codec)(transit-base64-codec prefix)Creates the default URLCodec that encodes params as transit->base64->uri-encode.
URL shape: /Seg1/Seg2?_p=<base64-encoded-transit>.
When prefix is provided (e.g. "/app"), it is prepended on encode and stripped
on decode, allowing deployment under a sub-path.
Creates the default URLCodec that encodes params as transit->base64->uri-encode. URL shape: `/Seg1/Seg2?_p=<base64-encoded-transit>`. When `prefix` is provided (e.g. `"/app"`), it is prepended on encode and stripped on decode, allowing deployment under a sub-path.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |