Comparing version 0.21.0 to 0.22.0
@@ -1,2 +0,2 @@ | ||
module.exports=function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){function r(t){i(this),this._path=[],this._root=this,this._changes=this._state=a,this.commit(t)}var i=e(5),u=e(3),o=e(4),s=e(1),a={};r.prototype={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(),e=n._state;null==t&&(t=a),e!==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 e in n)this.set([t,e],n[e])},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 c=["sort","map","reduce","filter","forEach","some","every","join","indexOf"];c.forEach(function(t){r.prototype[t]=function(){var n;return(n=this.values())[t].apply(n,arguments)}}),t.exports=r},function(t,n,e){function r(t,n){return t?t[n]:void 0}t.exports=function(t,n,e){var i=n.reduce(r,t);return void 0===i?e:i}},function(t,n,e){t.exports=function(t){if(Array.isArray(t))return t.slice();var n={};for(var e in t)n[e]=t[e];return n}},function(t,n,e){var r=e(2),i=e(1);t.exports=function u(t,n,e){if(i(t,n)===e)return t;var o=n[0],s=n.slice(1),a=r(t);return n.length>1?a[o]=u(i(a,[o])||{},s,e):o?a[o]=e:a=e,a}},function(t,n,e){var r=e(2),i=e(1);t.exports=function u(t,n){if(void 0===i(t,n))return t;var e=n[0],o=n.slice(1),s=r(t);return o.length?(s[e]=u(t[e],o),0===Object.keys(s[e]).length&&delete s[e]):delete s[e],s}},function(t,n,e){function r(t){var n=[],e=t,i=null;t=this instanceof r?this:t||{};var u=function(e){for(var r=0;r<n.length;r++)n[r].apply(t,e)},o=function(){var t=+new Date;i&&10>t-i?cancelAnimationFrame(e):i=t};return t.listen=t.subscribe=function(e){return n=n.concat(e),t},t.ignore=t.unsubscribe=function(e){return n=n.filter(function(t){return t!==e}),t},t.emit=t.publish=function(){return u(arguments),t},t.volley=function(){return n.length>0&&(o(),e=requestAnimationFrame(u.bind(void 0,arguments))),t},t}var i=1e3/120;t.exports=r(r),t.exports.decorate=r,t.exports.FRAMES=i}]); | ||
module.exports=function(t){function n(r){if(e[r])return e[r].exports;var i=e[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}var e={};return n.m=t,n.c=e,n.p="",n(0)}([function(t,n,e){function r(t){i(this),this._path=c,this._root=this,this.state=a,this.commit(t)}var i=e(6),u=e(5),o=e(4),s=e(1),a={},c=[];r.prototype={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(),e=n.state;null==t&&(t=a),e!==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 e in n)this.set([t,e],n[e])},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){r.prototype[t]=function(){var n;return(n=this.values())[t].apply(n,arguments)}}),t.exports=r},function(t,n,e){var r=e(2);t.exports=function(t,n,e){n=r(n);for(var i=0;i<n.length;i++){if(void 0===t)return e;t=t[n[i]]}return void 0===t?e:t}},function(t,n,e){t.exports=function(t){return Array.isArray(t)?t:[t]}},function(t,n,e){t.exports=function(t){if(Array.isArray(t))return t.slice();var n={};for(var e in t)n[e]=t[e];return n}},function(t,n,e){var r={},i=e(3),u=e(1),o=e(2);t.exports=function s(t,n){if(void 0===u(t,n))return t;n=o(n);var e=n[0],a=n.slice(1),c=i(t);return a.length?(c[e]=s(u(t,e,r),a),0===Object.keys(u(c,e,r)).length&&delete c[e]):delete c[e],c}},function(t,n,e){var r=e(3),i=e(1),u=e(2);t.exports=function o(t,n,e){if(i(t,n)===e)return t;n=u(n);var s=n[0],a=n.slice(1);if(n.length){var c=r(t);return a.length?c[s]=o(i(c,s,{}),a,e):c[s]=e,c}return e}},function(t,n,e){function r(t){var n=[],e=t,i=null;t=this instanceof r?this:t||{};var u=function(e){for(var r=0;r<n.length;r++)n[r].apply(t,e)},o=function(){var t=+new Date;i&&10>t-i?cancelAnimationFrame(e):i=t};return t.listen=t.subscribe=function(e){return n=n.concat(e),t},t.ignore=t.unsubscribe=function(e){return n=n.filter(function(t){return t!==e}),t},t.emit=t.publish=function(){return u(arguments),t},t.volley=function(){return n.length>0&&(o(),e=requestAnimationFrame(u.bind(void 0,arguments))),t},t}var i=1e3/120;t.exports=r(r),t.exports.decorate=r,t.exports.FRAMES=i}]); | ||
//# sourceMappingURL=foliage.build.js.map |
{ | ||
"name": "foliage", | ||
"version": "0.21.0", | ||
"version": "0.22.0", | ||
"description": "A cursor like tree data structure.", | ||
@@ -5,0 +5,0 @@ "main": "src/Foliage.js", |
/** | ||
* Assoc | ||
* Given a list of keys, non-destructively assign a value to a | ||
* pathway | ||
* | ||
* @param {Object} obj - The target object | ||
* @param {Array} keys - A list of string keys | ||
* @param {any} value - The value to be assigned | ||
* DEPRECATED | ||
*/ | ||
var copy = require('./copy'); | ||
var get = require('./get'); | ||
var set = require('./set'); | ||
module.exports = function assoc(obj, keys, value) { | ||
if (get(obj, keys) === value) { | ||
return obj; | ||
} | ||
var head = keys[0]; | ||
var tail = keys.slice(1); | ||
var clone = copy(obj); | ||
if (keys.length > 1) { | ||
clone[head] = assoc(get(clone, [head]) || {}, tail, value); | ||
} else if (head) { | ||
clone[head] = value; | ||
} else { | ||
clone = value; | ||
} | ||
return clone; | ||
module.exports = function () { | ||
console.warn('set has been deprecated, please use `require(foliage/src/set`)'); | ||
return set.apply(this, arguments); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9hc3NvYy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBVUEsSUFBSSxJQUFJLEdBQUcsT0FBTyxVQUFVLENBQUE7QUFDNUIsSUFBSSxHQUFHLEdBQUksT0FBTyxTQUFTLENBQUE7O0FBRTNCLE1BQU0sQ0FBQyxPQUFPLEdBQUcsU0FBUyxLQUFLLENBQUUsR0FBRyxFQUFFLElBQUksRUFBRSxLQUFLLEVBQUU7QUFDakQsTUFBSSxHQUFHLENBQUMsR0FBRyxFQUFFLElBQUksQ0FBQyxLQUFLLEtBQUssRUFBRTtBQUM1QixXQUFPLEdBQUcsQ0FBQTtHQUNYOztNQUVLLElBQUksR0FBYyxJQUFJO01BQWIsSUFBSSxHQUFLL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remove a pathway from an | ||
* object | ||
* | ||
* @param {Object} obj - The target object | ||
* @param {Array} keys - A list of string keys | ||
* DEPRECATED | ||
*/ | ||
var copy = require('./copy'); | ||
var get = require('./get'); | ||
var remove = require('./remove'); | ||
module.exports = function dissoc(obj, keys) { | ||
if (get(obj, keys) === void 0) { | ||
return obj; | ||
} | ||
var head = keys[0]; | ||
var tail = keys.slice(1); | ||
var clone = copy(obj); | ||
if (tail.length) { | ||
clone[head] = dissoc(obj[head], tail); | ||
// Autoprune keys | ||
if (Object.keys(clone[head]).length === 0) { | ||
delete clone[head]; | ||
} | ||
} else { | ||
delete clone[head]; | ||
} | ||
return clone; | ||
module.exports = function () { | ||
console.warn('dissoc has been deprecated, please use `require(foliage/src/remove`)'); | ||
return remove.apply(this, arguments); | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaXNzb2MuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFRQSxJQUFJLElBQUksR0FBRyxPQUFPLFVBQVUsQ0FBQTtBQUM1QixJQUFJLEdBQUcsR0FBSSxPQUFPLFNBQVMsQ0FBQTs7QUFFM0IsTUFBTSxDQUFDLE9BQU8sR0FBRyxTQUFTLE1BQU0sQ0FBRSxHQUFHLEVBQUUsSUFBSSxFQUFFO0FBQzNDLE1BQUksR0FBRyxDQUFDLEdBQUcsRUFBRSxJQUFJLENBQUMsV0FBYyxFQUFFO0FBQ2hDLFdBQU8sR0FBRyxDQUFBO0dBQ1g7O01BRUssSUFBSSxHQUFjLElBQUk7TUFBYixJQUFJLEdBQUssSUFBSTs7QUFDNUIsTUFBSSxLQUFLLEdBQUcsSUFBSSxDQUFDLEdBQUcsQ0FBQyxDQUFBOztBQUVyQixNQUFJLElBQUksQ0FBQyxNQUFNLEVBQUU7QUFDZixTQUFLLENBQUMsSUFBSSxDQUFDLEdBQUcsTUFBTSxDQUFDLEdB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b25lW2hlYWRdKS5sZW5ndGggPT09IDApIHtcbiAgICAgIGRlbGV0ZSBjbG9uZVtoZWFkXVxuICAgIH1cbiAgfSBlbHNlIHtcbiAgICBkZWxldGUgY2xvbmVbaGVhZF1cbiAgfVxuXG4gIHJldHVybiBjbG9uZVxufVxuIl19 | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaXNzb2MuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUlBLElBQUksTUFBTSxHQUFHLE9BQU8sWUFBWSxDQUFBOztBQUVoQyxNQUFNLENBQUMsT0FBTyxHQUFHLFlBQVc7QUFDMUIsU0FBTyxDQUFDLElBQUksd0VBQXdFLENBQUE7QUFDcEYsU0FBTyxNQUFNLENBQUMsS0FBSyxDQUFDLElBQUksRUFBRSxTQUFTLENBQUMsQ0FBQTtDQUNyQyxDQUFBIiwiZmlsZSI6ImRpc3NvYy5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogREVQUkVDQVRFRFxuICovXG5cbmxldCByZW1vdmUgPSByZXF1aXJlKCcuL3JlbW92ZScpXG5cbm1vZHVsZS5leHBvcnRzID0gZnVuY3Rpb24oKSB7XG4gIGNvbnNvbGUud2FybignZGlzc29jIGhhcyBiZWVuIGRlcHJlY2F0ZWQsIHBsZWFzZSB1c2UgYHJlcXVpcmUoZm9saWFnZS9zcmMvcmVtb3ZlYCknKVxuICByZXR1cm4gcmVtb3ZlLmFwcGx5KHRoaXMsIGFyZ3VtZW50cylcbn1cbiJdfQ== |
@@ -9,7 +9,8 @@ /** | ||
var Diode = require('diode'); | ||
var assoc = require('./assoc'); | ||
var dissoc = require('./dissoc'); | ||
var setIn = require('./set'); | ||
var removeIn = require('./remove'); | ||
var getIn = require('./get'); | ||
var EMPTY = {}; | ||
var PATH = []; | ||
@@ -19,5 +20,5 @@ function Foliage(state) { | ||
this._path = []; | ||
this._path = PATH; | ||
this._root = this; | ||
this._changes = this._state = EMPTY; | ||
this.state = EMPTY; | ||
@@ -40,6 +41,6 @@ this.commit(state); | ||
commit: function commit() { | ||
var next = arguments[0] === void 0 ? this._state : arguments[0]; | ||
var next = arguments[0] === void 0 ? this.state : arguments[0]; | ||
var root = this.getRoot(); | ||
var current = root._state; | ||
var current = root.state; | ||
@@ -51,4 +52,4 @@ if (next == null) { | ||
if (current !== next) { | ||
root._state = next; | ||
this.volley(root._state); | ||
root.state = next; | ||
this.volley(root.state); | ||
} | ||
@@ -62,3 +63,3 @@ }, | ||
get: function get(key, fallback) { | ||
return getIn(this._state, this.getPath(key), fallback); | ||
return getIn(this.state, this.getPath(key), fallback); | ||
}, | ||
@@ -72,3 +73,3 @@ | ||
this.commit(assoc(this._state, this.getPath(key), value)); | ||
this.commit(setIn(this.state, this.getPath(key), value)); | ||
}, | ||
@@ -88,3 +89,3 @@ | ||
remove: function remove(key) { | ||
this.commit(dissoc(this._state, this.getPath(key))); | ||
this.commit(removeIn(this.state, this.getPath(key))); | ||
}, | ||
@@ -112,3 +113,3 @@ | ||
valueOf: function valueOf() { | ||
return getIn(this._state, this.getPath()); | ||
return getIn(this.state, this.getPath()); | ||
}, | ||
@@ -158,2 +159,2 @@ | ||
module.exports = Foliage; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Gb2xpYWdlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7QUFPQSxJQUFJLEtBQUssR0FBSSxPQUFPLFNBQVMsQ0FBQTtBQUM3QixJQUFJLEtBQUssR0FBSSxPQUFPLFdBQVcsQ0FBQTtBQUMvQixJQUFJLE1BQU0sR0FBRyxPQUFPLFlBQVksQ0FBQTtBQUNoQyxJQUFJLEtBQUssR0FBSSxPQUFPLFNBQVMsQ0FBQTs7QUFFN0IsSUFBTSxLQUFLLEdBQUcsRUFBRSxDQUFBOztBQUVo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iB0aGlzLnZhbHVlT2YoKVxuICB9LFxuXG4gIGlzKGJyYW5jaCkge1xuICAgIHJldHVybiBicmFuY2gudmFsdWVPZigpID09IHRoaXMudmFsdWVPZigpXG4gIH0sXG5cbiAgZmluZChmbiwgc2NvcGUpIHtcbiAgICByZXR1cm4gdGhpcy5maWx0ZXIoZm4sIHNjb3BlKVswXVxuICB9LFxuXG4gIGluY2x1ZGVzKHZhbHVlKSB7XG4gICAgcmV0dXJuIHRoaXMuaW5kZXhPZih2YWx1ZSkgPiAtMVxuICB9LFxuXG4gIGZpcnN0KCkge1xuICAgIHJldHVybiB0aGlzLnZhbHVlcygpLnNoaWZ0KClcbiAgfSxcblxuICBsYXN0KCkge1xuICAgIHJldHVybiB0aGlzLnZhbHVlcygpLnBvcCgpXG4gIH0sXG5cbiAgc2l6ZSgpIHtcbiAgICByZXR1cm4gdGhpcy52YWx1ZXMoKS5sZW5ndGhcbiAgfVxuXG59XG5cbi8vIEFkZCBjb2xsZWN0aW9uIG1ldGhvZHNcbmxldCBtZXRob2RzID0gWyAnc29ydCcsICdtYXAnLCAncmVkdWNlJywgJ2ZpbHRlcicsICdmb3JFYWNoJywgJ3NvbWUnLCAnZXZlcnknLCAnam9pbicsICdpbmRleE9mJyBdXG5cbm1ldGhvZHMuZm9yRWFjaChmdW5jdGlvbihuYW1lKSB7XG4gIEZvbGlhZ2UucHJvdG90eXBlW25hbWVdID0gZnVuY3Rpb24oKSB7XG4gICAgcmV0dXJuIHRoaXMudmFsdWVzKClbbmFtZV0oLi4uYXJndW1lbnRzKVxuICB9XG59KVxuXG5tb2R1bGUuZXhwb3J0cyA9IEZvbGlhZ2VcbiJdfQ== |
@@ -10,11 +10,17 @@ /** | ||
function pluck(obj, key) { | ||
return obj ? obj[key] : void 0; | ||
} | ||
var keyPath = require('./keyPath'); | ||
module.exports = function (obj, keys, fallback) { | ||
var value = keys.reduce(pluck, obj); | ||
module.exports = function get(target, keys, fallback) { | ||
keys = keyPath(keys); | ||
return value === void 0 ? fallback : value; | ||
for (var i = 0; i < keys.length; i++) { | ||
if (target !== void 0) { | ||
target = target[keys[i]]; | ||
} else { | ||
return fallback; | ||
} | ||
} | ||
return target === void 0 ? fallback : target; | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nZXQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBU0EsU0FBUyxLQUFLLENBQUMsR0FBRyxFQUFFLEdBQUcsRUFBRTtBQUN2QixTQUFPLEdBQUcsR0FBRyxHQUFHLENBQUMsR0FBRyxDQUFDLFNBQVksQ0FBQTtDQUNsQzs7QUFFRCxNQUFNLENBQUMsT0FBTyxHQUFHLFVBQVUsR0FBRyxFQUFFLElBQUksRUFBRSxRQUFRLEVBQUU7QUFDOUMsTUFBSSxLQUFLLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxLQUFLLEVBQUUsR0FBRyxDQUFDLENBQUE7O0FBRW5DLFNBQU8sS0FBSyxXQUFjLEdBQUcsUUFBUSxHQUFHLEtBQUssQ0FBQTtDQUM5QyxDQUFBIiwiZmlsZSI6ImdldC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2l2ZW4gYSBsaXN0IG9mIGtleXMsIHJldHVybiBhIHZhbHVlIG9mIG91dCBhIGdpdmVuIG9iamVjdC5cbiAqIE9wdGlvbmFsbHksIGlmIGEgdmFsdWUgaXMgbm90IHByZXNlbnQsIHJldHVybiBhIGZhbGxiYWNrXG4gKlxuICogQHBhcmFtIHtPYmplY3R9IG9iaiAtIFRoZSB0YXJnZXQgb2JqZWN0XG4gKiBAcGFyYW0ge0FycmF5fSBrZXlzIC0gQSBsaXN0IG9mIHN0cmluZyBrZXlzXG4gKiBAcGFyYW0ge2FueX0gZmFsbGJhY2sgLSBJZiB0aGUgdmFsdWUgaXMgdW5kZWZpbmVkLCBhIGZhbGxiYWN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iBrZXlzLCByZXR1cm4gYSB2YWx1ZSBvZiBvdXQgYSBnaXZlbiBvYmplY3QuXG4gKiBPcHRpb25hbGx5LCBpZiBhIHZhbHVlIGlzIG5vdCBwcmVzZW50LCByZXR1cm4gYSBmYWxsYmFja1xuICpcbiAqIEBwYXJhbSB7T2JqZWN0fSBvYmogLSBUaGUgdGFyZ2V0IG9iamVjdFxuICogQHBhcmFtIHtBcnJheX0ga2V5cyAtIEEgbGlzdCBvZiBzdHJpbmcga2V5c1xuICogQHBhcmFtIHthbnl9IGZhbGxiYWNrIC0gSWYgdGhlIHZhbHVlIGlzIHVuZGVmaW5lZCwgYSBmYWxsYmFja1xuICovXG5cbmxldCBrZXlQYXRoID0gcmVxdWlyZSgnLi9rZXlQYXRoJylcblxubW9kdWxlLmV4cG9ydHMgPSBmdW5jdGlvbiBnZXQodGFyZ2V0LCBrZXlzLCBmYWxsYmFjaykge1xuICBrZXlzID0ga2V5UGF0aChrZXlzKVxuXG4gIGZvciAodmFyIGkgPSAwOyBpIDwga2V5cy5sZW5ndGg7IGkrKykge1xuICAgIGlmICh0YXJnZXQgIT09IHVuZGVmaW5lZCkge1xuICAgICAgdGFyZ2V0ID0gdGFyZ2V0W2tleXNbaV1dXG4gICAgfSBlbHNlIHtcbiAgICAgIHJldHVybiBmYWxsYmFja1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB0YXJnZXQgPT09IHVuZGVmaW5lZCA/IGZhbGxiYWNrIDogdGFyZ2V0XG59XG4iXX0= |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98479
17
247
1