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

https://github.com/axtk/unpack-schema

Define and extract common schema types without importing those packages
https://github.com/axtk/unpack-schema

inference schema typed-schema yup zod

Last synced: 12 months ago
JSON representation

Define and extract common schema types without importing those packages

Awesome Lists containing this project

README

          

# unpack-schema

*Define and extract Zod or Yup schema types without importing those packages*

🔹 Define types accepting schemas created with Zod or Yup in an abstract way without importing those packages:

```ts
import type {Schema} from 'unpack-schema';

type ParamsShape = Record;
type Params = Schema;
```

🔹 Extract types from Zod/Yup schemas without importing `.infer` or `InferType` of those packages:

```ts
import type {UnpackedSchema} from 'unpack-schema';

function process(params: UnpackedSchema) {
// ...
}
```