New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

jsonpatch-rs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsonpatch-rs

```js let orig = { name: "hello", items: ["apple", "cherry"] }; let dest = { name: "hello2", items: ["apple", "banana"] };

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Usage

let orig = {
  name: "hello",
  items: ["apple", "cherry"]
};
let dest = {
  name: "hello2",
  items: ["apple", "banana"]
};

diff(orig, dest)
//[
//  { op: 'replace', path: '/items/1', value: 'banana' },
//  { op: 'replace', path: '/name', value: 'hello2' }
//]

Performance

It's about 10x slower than fast-json-patch. I imagine it's because copying values js <-> rust is slow. But I'm not sure.

image

FAQs

Package last updated on 09 May 2023

Related posts