Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uasi/inko-url_search_params

A URLSearchParams implementation.
https://github.com/uasi/inko-url_search_params

Last synced: 17 days ago
JSON representation

A URLSearchParams implementation.

Awesome Lists containing this project

README

        

# inko-url_search_params

An implementation of [the `URLSearchParams` class](https://url.spec.whatwg.org/#interface-urlsearchparams) from the URL Standard in the Inko programming language.

## Examples

import url_search_params (UrlSearchParams)

let params = UrlSearchParams.from_string('a=A+A%26A&n=1&n=2')

params.get('a') # => Option.Some('A A&A')
params.get('x') # => Option.None
params.get_all('n') # => ['1', '2']
params.get_all('x') # => []

# ---

let params = UrlSearchParams.new

params.set('a', 'will be overwritten')
params.set('a', 'A A&A')
params.append('n', '1')
params.append('n', '2')

params.to_string # => 'a=A+A%26A&n=1&n=2'