Socket
Socket
Sign inDemoInstall

object-history

Package Overview
Dependencies
5
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    object-history

Object History


Version published
Weekly downloads
389
increased by1.04%
Maintainers
1
Install size
1.13 MB
Created
Weekly downloads
 

Readme

Source

object-history NPM version Build Status js-standard-style

JavaScript Object history

Behind the scenes

For cloning, UltraDeepClone. For diff/apply, changeset.

Old browsers

Works in IE8 with es5-shim. Perhaps IE7, as well.

API

History

Gives birth to instances

  • initial {Object}: The initial history point
  • options {Object}: limit: {Number} Remember this many backward points
var History = require('object-history')
var initial = {foo: 'bar', name: 'victoria'}
var history = new History(initial, {limit: 33})

.add

Add a history point object

  • obj {Object}: The history point
history.add({
  foo: 'bar',
  bar: 'foo'
})

.backward

Go back one history point

.forgetAllBackward

Makes all backward history forgotten

.forgetAllForward

Makes all forward history forgotten

.forward

Go forward one history point

.get

  • returns {Object}: "Current" history point

.lengthBackward

  • returns {Number}: Number of history points backwards

.lengthForward

  • returns {Number}: Number of history points forward

License

Copyright © 2015 PolicyStat LLC

Released under the BSD-3-Clause license.

Keywords

FAQs

Last updated on 25 Apr 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc