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
- Host: GitHub
- URL: https://github.com/axtk/unpack-schema
- Owner: axtk
- Created: 2025-06-14T11:44:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-21T19:40:42.000Z (about 1 year ago)
- Last Synced: 2025-06-21T19:41:52.529Z (about 1 year ago)
- Topics: inference, schema, typed-schema, yup, zod
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/unpack-schema
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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) {
// ...
}
```