Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@n1ru4l/json-patch-plus

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@n1ru4l/json-patch-plus

This is a slimmed version of [jsondiffpatch](https://github.com/benjamine/jsondiffpatch). All the code is taken from the [jsondiffpatch](https://github.com/benjamine/jsondiffpatch) repository, slimmed down, slightly altered and converted to TypeScript.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15K
decreased by-25.36%
Maintainers
1
Weekly downloads
 
Created
Source

@n1ru4l/json-patch-plus

This is a slimmed version of jsondiffpatch. All the code is taken from the jsondiffpatch repository, slimmed down, slightly altered and converted to TypeScript.

Huge thanks to @benjamine, who did all the heavy work!

jsondiffpatch is a replacement for json-patch that produces more efficient patches!

@n1ru4l/json-patch-plus has the following changes:

  • Full ESM support
  • Remove Node.js runtime dependencies introduced through loggers
  • Remove class wrapper structures (make code less abstract and smaller)
  • Remove text diffing
  • Only generate and apply patch deltas (no reversing and visualization)
  • Exclude unnecessary data from patch deltas (previous value is replaced with null)

For a full description of the delta format please refer to the jsondiffpatch docs

Install Instructions

yarn install -E @n1ru4l/json-patch-plus

Usage

import { diff, patch } from "@n1ru4l/json-patch-plus";

const delta = diff({
  left: {},
  right: { a: { b: 1 } },
});

const result = patch({
  left: {},
  delta,
});

console.log(result);
// logs '{ a: { b: 1 } }'

Keywords

FAQs

Package last updated on 29 Jul 2022

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