0.0.1 • Published 9 years ago

temporal-hash v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
9 years ago

Temporal Hash Build Status

update(hash, timestamp)

  • hash - the data to add to the temporal hash
  • timestamp - optional defaulting to Date.now()

resolve()

Deep merge all of the hashes in order by time ascending and return the result.

compact(timestamp)

  • timestamp - optional defaulting to Date.now()

Same as resolve() however also clears internal store and adds one value to the store at the provided timestamp.

lodash.merge, null and undefined

Using lodash merge which by default ignores when keys have a value of undefined -- so keys can't be cleared. For example,

var _ = require('lodash');

_.merge({a: 10, q: 20}, {a: 42, q: undefined})

Returns:

{ a: 42, q: 20 }

However, if q: null, we would end up with:

{ a: 42, q: null }

It would be preferable to have q get cleared if it were set to undefined so that behavior will eventually be implemented.