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

immutable-undo

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

immutable-undo - npm Package Compare versions

Comparing version 1.1.1 to 2.0.0

.travis.yml

9

package.json
{
"name": "immutable-undo",
"version": "1.1.1",
"version": "2.0.0",
"description": "Data structure for and Undo/Redo stack, using ImmutableJS",

@@ -26,4 +26,4 @@ "main": "./dist/index.js",

"homepage": "https://github.com/Soreine/immutable-undo#readme",
"dependencies": {
"immutable": "^3.8.1"
"peerDependencies": {
"immutable": "^3.8.1 | ^4.0.0-rc.12"
},

@@ -41,4 +41,5 @@ "devDependencies": {

"expect": "^1.20.2",
"mocha": "^3.0.1"
"mocha": "^3.0.1",
"immutable": "^4.0.0-rc.12"
}
}

@@ -101,2 +101,29 @@ const expect = require('expect');

});
it('should handle undo redo, with Smooth strategy', () => {
// Serie of natural integers
const serie = [...Array(30).keys()];
const history = serie.reduce(
(h, n) => {
h = h.push(n);
const previous = h.previous;
h = h.undo(n + 1);
h = h.redo(previous);
return h;
},
History.create({ maxUndos: 3, strategy: History.smooth })
);
expect(history.previous).toEqual(29);
expect(history.undos.count()).toEqual(3);
expect(history.redos.count()).toEqual(0);
expect(
history.undos.toArray()
).toEqual([
{ value: 0, merged: 21 },
{ value: 21, merged: 8 },
{ value: 29, merged: 1 }
]);
});
});

Sorry, the diff of this file is not supported yet

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