diff --git a/README.md b/README.md index e579fde..1628220 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,11 @@ The current pieces are (more to come): A simple and fast type stripper. +### [TypedURLPattern](./packages/typed-url-pattern/README.md) + +A tiny wrapper around `URLPattern` to create type safe routes, endpoints and +links. Params are parsed and validated with `StandardSchema` + ### [Functorial](./packages/functorial/README.md) A new `Proxy`-based reactivity system, that goes beyond Signals. It's more diff --git a/packages/functorial/deno.json b/packages/functorial/deno.json index 1a4fcaf..20f3168 100644 --- a/packages/functorial/deno.json +++ b/packages/functorial/deno.json @@ -1,6 +1,6 @@ { "name": "@f-stack/functorial", - "version": "0.3.0", + "version": "0.3.1", "license": "MIT", "exports": { ".": "./src/reactive.ts" diff --git a/packages/typed-url-pattern/README.md b/packages/typed-url-pattern/README.md index 9169100..831c0f3 100644 --- a/packages/typed-url-pattern/README.md +++ b/packages/typed-url-pattern/README.md @@ -11,6 +11,14 @@ providing: ## Install +Depending on your package manager: + +```sh +deno add jsr:@f-stack/typed-url-pattern +pnpm i jsr:@f-stack/typed-url-pattern +npx jsr add @f-stack/typed-url-pattern +``` + ## Common patterns - **Typed named parameters** @@ -152,4 +160,4 @@ const href2 = route.href({ href2 === "https://example.com/42-mycake?page=2"; ``` -## API +## [API](https://jsr.io/@f-stack/typed-url-pattern/doc) diff --git a/packages/typed-url-pattern/assets/demo.mp4 b/packages/typed-url-pattern/assets/demo.mp4 new file mode 100644 index 0000000..b1c3e5a Binary files /dev/null and b/packages/typed-url-pattern/assets/demo.mp4 differ diff --git a/packages/typed-url-pattern/src/utils.ts b/packages/typed-url-pattern/src/utils.ts index c87c599..a1caf53 100644 --- a/packages/typed-url-pattern/src/utils.ts +++ b/packages/typed-url-pattern/src/utils.ts @@ -19,19 +19,19 @@ export type AreAllKeysOptional = {} extends FilterRequiredKeys ? true /** @internal */ export type And = T extends true -? U extends true -? true -: false -: false; + ? U extends true + ? true + : false + : false; // deno-fmt-ignore /** @internal */ export type Or = T extends true -? true -: U extends true -? true -: false; + ? true + : U extends true + ? true + : false; /** * Extracts the BaseURL from the input URL