Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mcansh/url
a template string function to create urls and only keeping search params with values - based on this tweet https://x.com/Steve8708/status/1792939860820644201
https://github.com/mcansh/url
Last synced: 16 days ago
JSON representation
a template string function to create urls and only keeping search params with values - based on this tweet https://x.com/Steve8708/status/1792939860820644201
- Host: GitHub
- URL: https://github.com/mcansh/url
- Owner: mcansh
- License: mit
- Created: 2024-06-11T00:27:43.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-01T20:57:40.000Z (2 months ago)
- Last Synced: 2024-10-18T06:27:53.883Z (26 days ago)
- Language: TypeScript
- Homepage:
- Size: 121 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @mcansh/url
a template string function to create urls and only keeping search params with values - based on [this tweet](https://x.com/Steve8708/status/1792939860820644201)
```ts
let filter = undefined;
let user = null;
let q = "my search";
urlString`https://site.com/path?q=${q}&user=${user}&filter=${filter}`;
// => "https://site.com/path?q=my+search"
```
```