
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A persistent data structure to manage undos and redos
var undore = require('undore');
// initialize the state to 10
var dataState = undore(10);
// operations does not mutate the original object
undore.set(dataState, 5);
console.log(undore.get(dataState)); // 10
// but we can manually reasign our variable
dataState = undore.set(dataState, 5);
console.log(undore.get(dataState)); // 5
// maybe 5 isn't really a nice value, let's rollback
dataState = undore.undo(dataState);
console.log(undore.get(dataState)); // 10
// nevermind, 5 is pretty awesome
dataState = undore.redo(dataState);
console.log(undore.get(dataState)); // 5
Constructor of an Undore instance. This instance is in fact an instance of Immutable.Map
with three keys:
state
: The most recent and valid version of the statehistory
: An Immutable.Stack
that contains every past versions of the state.redos
: Also an Immutable.Stack
with changes that were undone and may be redone.Note: Undore does not enforce the use of immutable object as its state.
Change the value and record the change in the history.
Get the current value.
Update the state with a function of previous state to next state. These are equivalent:
undore.set(myState, updater(undore.get(myState)))
undore.update(myState, updater)
Undo the latest change if any.
Redo the latest undo if any.
MIT
FAQs
Redo/Undo
We found that undore demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.