deep-patch-data
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

deep-patch-data

Patch data with data path.

Usage

import { patch } from 'deep-patch-data'

patch(object, {
  key: 'value',
  'data.path["computed member"][1]': 'deepValue'
})

/**
 * result:
 *
 * {
 *   key: 'value',
 *   data: {
 *     path: {
 *       'computed member': [
 *         ,
 *         'deepValue'
 *       ]
 *     }
 *   }
 * }
 */

Options

protectedKeys: string[]

Prevent specific keys from being overwritten.

set: Function

Custom setter function.

Readme

Keywords

none

Package Sidebar

Install

npm i deep-patch-data

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

27 kB

Total Files

5

Last publish

Collaborators

  • gzzhanghao