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

object-history

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-history

Object History

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
317
decreased by-17.02%
Maintainers
1
Weekly downloads
 
Created
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.

Constructor

History

Gives birth to instances

  • initial {Object}: The initial history point
  • options {Object}: Optional options
var History = require('object-history')
var initial = {foo: 'bar', name: 'victoria'}
var history = new History(initial)
Constructor options

limit Optional. Provide a number of backwards history points to keep. Older than this number will be forgotten and hopefully their allocated memory will be reclaimed.

Methods

add

Add a history point object

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

backward

Go back one history point](./lib/prototype/backward.js#L11)

forward

Go forward one history point

get

  • returns {Object}: "Current" history point

Get the "current" history point

lengthBackward

  • returns {Number}: Number of history points backwards

lengthForward

  • returns {Number}: Number of history points forward

Copyright © 2015 PolicyStat LLC

Keywords

FAQs

Package last updated on 14 Apr 2015

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