Socket
Socket
Sign inDemoInstall

@sanity/mutator

Package Overview
Dependencies
Maintainers
7
Versions
1321
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sanity/mutator

A set of models to make it easier to utilize the powerful real time collaborative features of Sanity


Version published
Weekly downloads
218K
decreased by-4.34%
Maintainers
7
Weekly downloads
 
Created
Source

@sanity/mutator

Features

  • Sanity flavored jsonpath matching engine with flexible interface that plays well with React
  • An implementation of the mutation operations of Sanity that can be applied to vanilla javascript objects, or through a flexible interface: any weird document representation you may require
  • TODO: A model to track documents as they are mutated both locally and remotely through the real time query feature of Sanity

Usage

import {Patcher} from '@sanity/mutator'

const document = {
  a: {}
}

const patcher = new Patcher({
  set: {
    'a.b': 'My new value'
  }
})

console.log(patcher.apply(document))

=> {
  a: {
    b: 'My new value'
  }
}

FAQs

Package last updated on 24 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc