Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

foliage

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

foliage - npm Package Compare versions

Comparing version 0.24.1 to 0.25.0

2

foliage.build.js

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

module.exports=function(t){function n(e){if(r[e])return r[e].exports;var i=r[e]={exports:{},id:e,loaded:!1};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){function e(){return e.prototype.constructor.apply(this,arguments)}var i=r(6),u=r(5),o=r(4),s=r(1),a={},c=[];e.prototype={constructor:function(t){i(this),this._path=c,this._root=this,this.state=a,this.commit(t)},getPath:function(t){return this._path.concat(t).filter(function(t){return void 0!==t})},getRoot:function(){return this._root},commit:function(){var t=void 0===arguments[0]?this.state:arguments[0],n=this.getRoot(),r=n.state;null==t&&(t=a),r!==t&&(n.state=t,this.volley(n.state))},clear:function(){this.commit(null)},get:function(t,n){return s(this.state,this.getPath(t),n)},set:function(t,n){1===arguments.length&&(n=arguments[0],t=void 0),this.commit(u(this.state,this.getPath(t),n))},update:function(t,n){1===arguments.length&&(n=arguments[0],t=void 0);for(var r in n)this.set([t,r],n[r])},remove:function(t){this.commit(o(this.state,this.getPath(t)))},refine:function(t){return Object.create(this,{_path:{value:this.getPath(t)}})},keys:function(){return Object.keys(this.valueOf()||{})},values:function(){return this.keys().map(function(t){return this.get(t)},this)},valueOf:function(){return s(this.state,this.getPath())},toJSON:function(){return this.valueOf()},is:function(t){return t.valueOf()==this.valueOf()},find:function(t,n){return this.filter(t,n)[0]},includes:function(t){return this.indexOf(t)>-1},first:function(){return this.values().shift()},last:function(){return this.values().pop()},size:function(){return this.values().length}};var f=["sort","map","reduce","filter","forEach","some","every","join","indexOf"];f.forEach(function(t){e.prototype[t]=function(){var n;return(n=this.values())[t].apply(n,arguments)}}),t.exports=e},function(t,n,r){var e=r(2);t.exports=function(t,n,r){n=e(n);for(var i=0;i<n.length;i++){if(void 0===t)return r;t=t[n[i]]}return void 0===t?r:t}},function(t,n,r){t.exports=function(t){return Array.isArray(t)?t:[t]}},function(t,n,r){t.exports=function(t){if(Array.isArray(t))return t.slice();var n={};for(var r in t)n[r]=t[r];return n}},function(t,n,r){function e(t){return Array.isArray(t)?t:Array.from(t)}var i={},u=r(3),o=r(1),s=r(2);t.exports=function a(t,n){if(void 0===o(t,n))return t;n=s(n);var r=e(n),c=r[0],f=r.slice(1),h=u(t);return f.length?(h[c]=a(o(t,c,i),f),0===Object.keys(o(h,c,i)).length&&delete h[c]):delete h[c],h}},function(t,n,r){function e(t){return Array.isArray(t)?t:Array.from(t)}var i=r(3),u=r(1),o=r(2);t.exports=function s(t,n,r){if(u(t,n)===r)return t;n=o(n);var a=e(n),c=a[0],f=a.slice(1);if(n.length){var h=i(t);return f.length?h[c]=s(u(h,c,{}),f,r):h[c]=r,h}return r}},function(t,n,r){function e(t){var n=[],r=t,i=null;t=this instanceof e?this:t||{};var u=function(r){for(var e=0;e<n.length;e++)n[e].apply(t,r)},o=function(){var t=+new Date;i&&10>t-i?cancelAnimationFrame(r):i=t};return t.listen=t.subscribe=function(r){return n=n.concat(r),t},t.ignore=t.unsubscribe=function(r){return n=n.filter(function(t){return t!==r}),t},t.emit=t.publish=function(){return u(arguments),t},t.volley=function(){return n.length>0&&(o(),r=requestAnimationFrame(u.bind(void 0,arguments))),t},t}var i=1e3/120;t.exports=e(e),t.exports.decorate=e,t.exports.FRAMES=i}]);
module.exports=function(t){function n(e){if(r[e])return r[e].exports;var i=r[e]={exports:{},id:e,loaded:!1};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var r={};return n.m=t,n.c=r,n.p="",n(0)}([function(t,n,r){function e(t){i(this),this._path=c,this._root=this,this.state=a,this.commit(t)}var i=r(6),u=r(5),o=r(4),s=r(1),a={},c=[];e.prototype={constructor:e,getPath:function(t){return this._path.concat(t).filter(function(t){return void 0!==t})},getRoot:function(){return this._root},commit:function(){var t=void 0===arguments[0]?this.state:arguments[0],n=this.getRoot(),r=n.state;null==t&&(t=a),r!==t&&(n.state=t,this.emit(n.state))},clear:function(){this.commit(null)},get:function(t,n){return s(this.state,this.getPath(t),n)},set:function(t,n){1===arguments.length&&(n=arguments[0],t=void 0),this.commit(u(this.state,this.getPath(t),n))},update:function(t,n){1===arguments.length&&(n=arguments[0],t=void 0);for(var r in n)this.set([t,r],n[r])},remove:function(t){this.commit(o(this.state,this.getPath(t)))},refine:function(t){return Object.create(this,{_path:{value:this.getPath(t)}})},keys:function(){return Object.keys(this.valueOf()||{})},values:function(){return this.keys().map(function(t){return this.get(t)},this)},valueOf:function(){return s(this.state,this.getPath())},toJSON:function(){return this.valueOf()},is:function(t){return t.valueOf()==this.valueOf()},find:function(t,n){return this.filter(t,n)[0]},includes:function(t){return this.indexOf(t)>-1},first:function(){return this.values().shift()},last:function(){return this.values().pop()},size:function(){return this.values().length}};var f=["sort","map","reduce","filter","forEach","some","every","join","indexOf"];f.forEach(function(t){e.prototype[t]=function(){var n;return(n=this.values())[t].apply(n,arguments)}}),t.exports=e},function(t,n,r){var e=r(2);t.exports=function(t,n,r){n=e(n);for(var i=0;i<n.length;i++){if(void 0===t)return r;t=t[n[i]]}return void 0===t?r:t}},function(t,n,r){t.exports=function(t){return Array.isArray(t)?t:[t]}},function(t,n,r){t.exports=function(t){if(Array.isArray(t))return t.slice();var n={};for(var r in t)n[r]=t[r];return n}},function(t,n,r){function e(t){return Array.isArray(t)?t:Array.from(t)}var i={},u=r(3),o=r(1),s=r(2);t.exports=function a(t,n){if(void 0===o(t,n))return t;n=s(n);var r=e(n),c=r[0],f=r.slice(1),h=u(t);return f.length?(h[c]=a(o(t,c,i),f),0===Object.keys(o(h,c,i)).length&&delete h[c]):delete h[c],h}},function(t,n,r){function e(t){return Array.isArray(t)?t:Array.from(t)}var i=r(3),u=r(1),o=r(2);t.exports=function s(t,n,r){if(u(t,n)===r)return t;n=o(n);var a=e(n),c=a[0],f=a.slice(1);if(n.length){var h=i(t);return f.length?h[c]=s(u(h,c,{}),f,r):h[c]=r,h}return r}},function(t,n,r){function e(t){var n=[],r=t,i=null;t=this instanceof e?this:t||{};var u=function(r){for(var e=0;e<n.length;e++)n[e].apply(t,r)},o=function(){var t=+new Date;i&&10>t-i?cancelAnimationFrame(r):i=t};return t.listen=t.subscribe=function(r){return n=n.concat(r),t},t.ignore=t.unsubscribe=function(r){return n=n.filter(function(t){return t!==r}),t},t.emit=t.publish=function(){return u(arguments),t},t.volley=function(){return n.length>0&&(o(),r=requestAnimationFrame(u.bind(void 0,arguments))),t},t}var i=1e3/120;t.exports=e(e),t.exports.decorate=e,t.exports.FRAMES=i}]);
//# sourceMappingURL=foliage.build.js.map
{
"name": "foliage",
"version": "0.24.1",
"version": "0.25.0",
"description": "A cursor like tree data structure.",

@@ -5,0 +5,0 @@ "main": "src/Foliage.js",

@@ -16,18 +16,15 @@ /**

function Foliage() {
return Foliage.prototype.constructor.apply(this, arguments);
function Foliage(state) {
Diode(this);
this._path = PATH;
this._root = this;
this.state = EMPTY;
this.commit(state);
}
Foliage.prototype = {
constructor: Foliage,
constructor: function constructor(state) {
Diode(this);
this._path = PATH;
this._root = this;
this.state = EMPTY;
this.commit(state);
},
getPath: function getPath(key) {

@@ -44,3 +41,3 @@ return this._path.concat(key).filter(function (i) {

commit: function commit() {
var next = arguments[0] === void 0 ? this.state : arguments[0];
var next = arguments[0] === undefined ? this.state : arguments[0];

@@ -56,3 +53,3 @@ var root = this.getRoot();

root.state = next;
this.volley(root.state);
this.emit(root.state);
}

@@ -158,2 +155,2 @@ },

module.exports = Foliage;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Gb2xpYWdlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFPQSxJQU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hbmNoKSB7XG4gICAgcmV0dXJuIGJyYW5jaC52YWx1ZU9mKCkgPT0gdGhpcy52YWx1ZU9mKClcbiAgfSxcblxuICBmaW5kKGZuLCBzY29wZSkge1xuICAgIHJldHVybiB0aGlzLmZpbHRlcihmbiwgc2NvcGUpWzBdXG4gIH0sXG5cbiAgaW5jbHVkZXModmFsdWUpIHtcbiAgICByZXR1cm4gdGhpcy5pbmRleE9mKHZhbHVlKSA+IC0xXG4gIH0sXG5cbiAgZmlyc3QoKSB7XG4gICAgcmV0dXJuIHRoaXMudmFsdWVzKCkuc2hpZnQoKVxuICB9LFxuXG4gIGxhc3QoKSB7XG4gICAgcmV0dXJuIHRoaXMudmFsdWVzKCkucG9wKClcbiAgfSxcblxuICBzaXplKCkge1xuICAgIHJldHVybiB0aGlzLnZhbHVlcygpLmxlbmd0aFxuICB9XG5cbn1cblxuLy8gQWRkIGNvbGxlY3Rpb24gbWV0aG9kc1xubGV0IG1ldGhvZHMgPSBbICdzb3J0JywgJ21hcCcsICdyZWR1Y2UnLCAnZmlsdGVyJywgJ2ZvckVhY2gnLCAnc29tZScsICdldmVyeScsICdqb2luJywgJ2luZGV4T2YnIF1cblxubWV0aG9kcy5mb3JFYWNoKGZ1bmN0aW9uKG5hbWUpIHtcbiAgRm9saWFnZS5wcm90b3R5cGVbbmFtZV0gPSBmdW5jdGlvbigpIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXMoKVtuYW1lXSguLi5hcmd1bWVudHMpXG4gIH1cbn0pXG5cbm1vZHVsZS5leHBvcnRzID0gRm9saWFnZVxuIl19

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