https://github.com/productdevbookcom/schob
Rewrite the new object according to the schema. Delete the excess.
https://github.com/productdevbookcom/schob
Last synced: about 1 year ago
JSON representation
Rewrite the new object according to the schema. Delete the excess.
- Host: GitHub
- URL: https://github.com/productdevbookcom/schob
- Owner: productdevbookcom
- License: mit
- Created: 2023-05-21T03:21:25.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-06-13T23:51:18.000Z (about 1 year ago)
- Last Synced: 2025-06-14T00:28:14.120Z (about 1 year ago)
- Language: TypeScript
- Size: 1.19 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Schob

## Installation
```bash
pnpm add schob
```
## Usage
```ts
import { merge } from 'schob'
const schema = {
isPro: false,
darkMode: false,
pages: {
home: false,
settings: false,
},
}
const newData = {
isPro: false,
darkMode: true,
pages: {
home: false,
settings: true,
hello: false,
},
dd: 'dd',
tt: {
dd: 'dd',
},
cc: [{ dd: 'dd' }],
}
const res = merge({ schema, newData })
```
### Output
```bash
{
isPro: false,
darkMode: true,
pages: { home: false, settings: true },
}
```
## Sponsors
## License
MIT License © 2022-PRESENT [productdevbook](https://github.com/productdevbook)