New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

deltaplane

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deltaplane

Proxy to keep original data read-only, but read and write changes using separate 'delta' object.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

DeltaPlane

Proxy to keep original data unchanged, but read and write changes using additional layer - 'delta' object.

npm install deltaplane
var o = { a:{b:{c:'original'}}, hello: 'world'};

var dp = DeltaPlane(o);
var p = dp.getPlane();
// if not changed then read from original
console.log(p.a.b.c); // 'original'
console.log(p.hello); // 'world'
// collect all changes in separate 'delta' object
p.a.b.c = 1;
// read changed values from delta
console.log(p.a.b.c); // '1'
// not changed value is still there
console.log(p.hello); // 'world'
// delta will have only changes
console.log(dp.getDelta()); // { a:{b:{c:1}}};
console.log(o);// original object is still safe.
// use existing deltas
var delta = {hello:"hi"};
dp = DeltaPlane(o, delta);
p = dp.getPlane();
console.log(p.hello);
console.log(p.a.b.c);
p.a.b.c = 2;
console.log(delta);

p = dp.getPlane(['a','b']);// specify base level other then root.
p.c = 3;
console.log(delta);

p = dp.getPlane(['x','y']);// specify base level for not existing original
p.z='ZZZZ';

console.log(delta);

Keywords

FAQs

Package last updated on 10 Nov 2020

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