1.0.0 • Published 2 years ago

deep-patch-data v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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.