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

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.

Awesome Lists containing this project

README

          

# Schob

![Schob](https://github.com/productdevbookcom/schob/blob/main/.github/assets/schob.png?raw=true)

## 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



sponsors

## License

MIT License © 2022-PRESENT [productdevbook](https://github.com/productdevbook)