Schob

Rewrite the new object according to the schema. Delete the excess.

Version Downloads License Github Stars Discord

Setup

pnpm
pnpm add @huntersofbook/schob
yarn
yarn add @huntersofbook/schob
npm
npm add @huntersofbook/schob

Usage

import { merge } from '@huntersofbook/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 })

License

MIT License © 2022-PRESENT productdevbook

Table of Contents