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

undoo

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

undoo - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

3

CHANGELOG.md

@@ -7,2 +7,5 @@ # Change Log

[0.3.2] - 2018-02-15
- **Fixed** `canUndo` issue
[0.3.1] - 2018-02-15

@@ -9,0 +12,0 @@ - **Changed** `canRedo` and `canUndo` method, now are public

4

dist/undoo.js

@@ -1,2 +0,2 @@

// [AIV] Undoo Build version: 0.3.1
// [AIV] Undoo Build version: 0.3.2
(function webpackUniversalModuleDefinition(root, factory) {

@@ -175,3 +175,3 @@ if(typeof exports === 'object' && typeof module === 'object')

value: function canUndo() {
return this._position > 0;
return this._position > 1;
}

@@ -178,0 +178,0 @@

@@ -1,2 +0,2 @@

// [AIV] Undoo Build version: 0.3.1
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Undoo",[],e):"object"==typeof exports?exports.Undoo=e():t.Undoo=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";t.exports=n(1)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=n(2),u=n(4),c=function(){function t(e){o(this,t),Object.defineProperties(this,{_opts:{writable:!0},_history:{writable:!0},_position:{writable:!0},_onUpdate:{writable:!0,value:function(){}},_onBeforeSave:{writable:!0,value:function(){}}}),this._opts=i.copy(e,{provider:null,maxLength:20}),this._initiliaze()}return r(t,[{key:"_initiliaze",value:function(){this._history=[],this._position=0}},{key:"_checkExceeded",value:function(){this.count()>this._opts.maxLength&&(this._history=this._history.slice(1,this.count()))}},{key:"canUndo",value:function(){return this._position>0}},{key:"canRedo",value:function(){return this._position<this.count()}},{key:"import",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw new TypeError("Items must be an array");return this._initiliaze(),this._history=t,this._position=this.count(),this}},{key:"history",value:function(){return this._history}},{key:"save",value:function(t){void 0===t&&"function"==typeof this._opts.provider&&(t=this._opts.provider());var e=this._onBeforeSave.call(null,t);return t=e||t,u(t,this.current())||!1===e?this:(this._position<this.count()&&(this._history=this._history.slice(0,this._position)),void 0!==t&&this._history.push(t),this._checkExceeded(),this._position=this.count(),this._onUpdate.call(null,this.current(),"save",this.history()),this)}},{key:"clear",value:function(){return this._initiliaze(),this._onUpdate.call(null,null,"clear",this.history()),this}},{key:"undo",value:function(t){return this.canUndo()&&(this._position--,"function"==typeof t&&t(this.current()),this._onUpdate.call(null,this.current(),"undo",this.history())),this}},{key:"redo",value:function(t){return this.canRedo()&&(this._position++,"function"==typeof t&&t(this.current()),this._onUpdate.call(null,this.current(),"redo",this.history())),this}},{key:"current",value:function(){return this.count()?this._history[this._position-1]:null}},{key:"count",value:function(){return this._history.length}},{key:"onUpdate",value:function(e){return t.callbackError(e),this._onUpdate=e,this}},{key:"onBeforeSave",value:function(e){return t.callbackError(e),this._onBeforeSave=e,this}}],[{key:"callbackError",value:function(t){if("function"!=typeof t)throw new TypeError("callback must be a function")}}]),t}();t.exports=c},function(t,e,n){"use strict";(function(t){var n,o,r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(u,c){"object"===i(e)&&"object"===i(t)?t.exports=c():(o=[],n=c,void 0!==(r="function"==typeof n?n.apply(e,o):n)&&(t.exports=r))}("undefined"!=typeof self&&self,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var o="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":i(t)},r=n(2),u=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var i in n)n.hasOwnProperty(i)&&-1===r.indexOf(i)&&(e.hasOwnProperty(i)&&void 0!==e[i]?"object"===o(e[i])&&t(e[i],n[i]):e[i]=n[i]);return e},c=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e[0]=r(e[0]),u.apply(void 0,e)};t.exports=u,t.exports.copy=c},function(t,e,n){var o,r,u="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":i(t)};!function(i,c,s){"object"===u(e)?t.exports=s():(o=s,void 0!==(r="function"==typeof o?o.call(e,n,e,t):o)&&(t.exports=r))}(0,0,function(){function t(t,e,n){return t instanceof Array?(t.push(n),t[t.length-1]):t instanceof Object?(t[e]=n,t[e]):void 0}return function(e){function n(e,o){for(var r in e){var i=e[r];if(i instanceof Date){var u=new Date(i.getTime());t(o,r,u)}else if(i instanceof Function){var u=i;t(o,r,u)}else if(i instanceof Array){var u=[],c=t(o,r,u);n(i,c)}else if(i instanceof Object){var u={},c=t(o,r,u);n(i,c)}else{var u=i;t(o,r,u)}}}if(/number|string|boolean/.test(void 0===e?"undefined":u(e)))return e;if(e instanceof Date)return new Date(e.getTime());var o=e instanceof Array?[]:{};return n(e,o),o}})}])})}).call(e,n(3)(t))},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function t(e,n){if(e===n)return!0;var r,i=Array.isArray(e),u=Array.isArray(n);if(i&&u){if(e.length!=n.length)return!1;for(r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}if(i!=u)return!1;if(e&&n&&"object"===(void 0===e?"undefined":o(e))&&"object"===(void 0===n?"undefined":o(n))){var c=Object.keys(e);if(c.length!==Object.keys(n).length)return!1;var s=e instanceof Date,f=n instanceof Date;if(s&&f)return e.getTime()==n.getTime();if(s!=f)return!1;var a=e instanceof RegExp,l=n instanceof RegExp;if(a&&l)return e.toString()==n.toString();if(a!=l)return!1;for(r=0;r<c.length;r++)if(!Object.prototype.hasOwnProperty.call(n,c[r]))return!1;for(r=0;r<c.length;r++)if(!t(e[c[r]],n[c[r]]))return!1;return!0}return!1}}])});
// [AIV] Undoo Build version: 0.3.2
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("Undoo",[],e):"object"==typeof exports?exports.Undoo=e():t.Undoo=e()}("undefined"!=typeof self?self:this,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){"use strict";t.exports=n(1)},function(t,e,n){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(e,n,o){return n&&t(e.prototype,n),o&&t(e,o),e}}(),i=n(2),u=n(4),c=function(){function t(e){o(this,t),Object.defineProperties(this,{_opts:{writable:!0},_history:{writable:!0},_position:{writable:!0},_onUpdate:{writable:!0,value:function(){}},_onBeforeSave:{writable:!0,value:function(){}}}),this._opts=i.copy(e,{provider:null,maxLength:20}),this._initiliaze()}return r(t,[{key:"_initiliaze",value:function(){this._history=[],this._position=0}},{key:"_checkExceeded",value:function(){this.count()>this._opts.maxLength&&(this._history=this._history.slice(1,this.count()))}},{key:"canUndo",value:function(){return this._position>1}},{key:"canRedo",value:function(){return this._position<this.count()}},{key:"import",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!Array.isArray(t))throw new TypeError("Items must be an array");return this._initiliaze(),this._history=t,this._position=this.count(),this}},{key:"history",value:function(){return this._history}},{key:"save",value:function(t){void 0===t&&"function"==typeof this._opts.provider&&(t=this._opts.provider());var e=this._onBeforeSave.call(null,t);return t=e||t,u(t,this.current())||!1===e?this:(this._position<this.count()&&(this._history=this._history.slice(0,this._position)),void 0!==t&&this._history.push(t),this._checkExceeded(),this._position=this.count(),this._onUpdate.call(null,this.current(),"save",this.history()),this)}},{key:"clear",value:function(){return this._initiliaze(),this._onUpdate.call(null,null,"clear",this.history()),this}},{key:"undo",value:function(t){return this.canUndo()&&(this._position--,"function"==typeof t&&t(this.current()),this._onUpdate.call(null,this.current(),"undo",this.history())),this}},{key:"redo",value:function(t){return this.canRedo()&&(this._position++,"function"==typeof t&&t(this.current()),this._onUpdate.call(null,this.current(),"redo",this.history())),this}},{key:"current",value:function(){return this.count()?this._history[this._position-1]:null}},{key:"count",value:function(){return this._history.length}},{key:"onUpdate",value:function(e){return t.callbackError(e),this._onUpdate=e,this}},{key:"onBeforeSave",value:function(e){return t.callbackError(e),this._onBeforeSave=e,this}}],[{key:"callbackError",value:function(t){if("function"!=typeof t)throw new TypeError("callback must be a function")}}]),t}();t.exports=c},function(t,e,n){"use strict";(function(t){var n,o,r,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(u,c){"object"===i(e)&&"object"===i(t)?t.exports=c():(o=[],n=c,void 0!==(r="function"==typeof n?n.apply(e,o):n)&&(t.exports=r))}("undefined"!=typeof self&&self,function(){return function(t){function e(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.d=function(t,n,o){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:o})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=0)}([function(t,e,n){t.exports=n(1)},function(t,e,n){var o="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":i(t)},r=n(2),u=function t(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];for(var i in n)n.hasOwnProperty(i)&&-1===r.indexOf(i)&&(e.hasOwnProperty(i)&&void 0!==e[i]?"object"===o(e[i])&&t(e[i],n[i]):e[i]=n[i]);return e},c=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return e[0]=r(e[0]),u.apply(void 0,e)};t.exports=u,t.exports.copy=c},function(t,e,n){var o,r,u="function"==typeof Symbol&&"symbol"===i(Symbol.iterator)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":void 0===t?"undefined":i(t)};!function(i,c,s){"object"===u(e)?t.exports=s():(o=s,void 0!==(r="function"==typeof o?o.call(e,n,e,t):o)&&(t.exports=r))}(0,0,function(){function t(t,e,n){return t instanceof Array?(t.push(n),t[t.length-1]):t instanceof Object?(t[e]=n,t[e]):void 0}return function(e){function n(e,o){for(var r in e){var i=e[r];if(i instanceof Date){var u=new Date(i.getTime());t(o,r,u)}else if(i instanceof Function){var u=i;t(o,r,u)}else if(i instanceof Array){var u=[],c=t(o,r,u);n(i,c)}else if(i instanceof Object){var u={},c=t(o,r,u);n(i,c)}else{var u=i;t(o,r,u)}}}if(/number|string|boolean/.test(void 0===e?"undefined":u(e)))return e;if(e instanceof Date)return new Date(e.getTime());var o=e instanceof Array?[]:{};return n(e,o),o}})}])})}).call(e,n(3)(t))},function(t,e,n){"use strict";t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function t(e,n){if(e===n)return!0;var r,i=Array.isArray(e),u=Array.isArray(n);if(i&&u){if(e.length!=n.length)return!1;for(r=0;r<e.length;r++)if(!t(e[r],n[r]))return!1;return!0}if(i!=u)return!1;if(e&&n&&"object"===(void 0===e?"undefined":o(e))&&"object"===(void 0===n?"undefined":o(n))){var c=Object.keys(e);if(c.length!==Object.keys(n).length)return!1;var s=e instanceof Date,f=n instanceof Date;if(s&&f)return e.getTime()==n.getTime();if(s!=f)return!1;var a=e instanceof RegExp,l=n instanceof RegExp;if(a&&l)return e.toString()==n.toString();if(a!=l)return!1;for(r=0;r<c.length;r++)if(!Object.prototype.hasOwnProperty.call(n,c[r]))return!1;for(r=0;r<c.length;r++)if(!t(e[c[r]],n[c[r]]))return!1;return!0}return!1}}])});
{
"name": "undoo",
"version": "0.3.1",
"version": "0.3.2",
"description": "Undo/redo manager",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -68,3 +68,3 @@ const extend = require('defaulty');

canUndo() {
return this._position > 0;
return this._position > 1;
}

@@ -71,0 +71,0 @@

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