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

lill

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lill - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

38

lib/lill-browser.js

@@ -11,5 +11,7 @@ !function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.lill=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.3.2
*/
'use strict';
var LiLL, Symbol, add, attach, bData, bOwner, checkAttached, checkItem, clear, detach, each, getHead, getNext, getPrevious, getSize, getTail, has, isAttached, remove;
var LiLL, Symbol, add, attach, bData, bOwner, checkAttached, checkItem, clear, detach, each, each$noContext, each$withContext, getHead, getNext, getPrevious, getSize, getTail, has, idSequence, isAttached, remove;

@@ -22,2 +24,4 @@ Symbol = require('es6-symbol');

idSequence = 0;
attach = function(owner) {

@@ -40,4 +44,6 @@ var data, _ref;

tail: null,
size: 0
size: 0,
id: idSequence
};
idSequence += 1;
Object.seal(data);

@@ -154,3 +160,3 @@ return owner;

each = function(owner, cb, ctx) {
var data, i, item, _results;
var data, i, item, iterator, next;
data = checkAttached(owner);

@@ -160,20 +166,26 @@ if (typeof cb !== 'function') {

}
i = 0;
if (!(item = data.head)) {
return;
return i;
}
i = 0;
ctx || (ctx = cb);
_results = [];
iterator = ctx !== void 0 ? each$withContext : each$noContext;
while (true) {
cb.call(ctx, item, i++);
item = item[data.next];
if (!item) {
next = item[data.next];
iterator(cb, item, i, ctx);
if (!(item = next)) {
break;
} else {
_results.push(void 0);
}
i += 1;
}
return _results;
return i;
};
each$noContext = function(fn, item, i) {
return fn(item, i);
};
each$withContext = function(fn, item, i, ctx) {
return fn.call(ctx, item, i);
};
isAttached = function(owner) {

@@ -180,0 +192,0 @@ return owner[bData] != null;

@@ -10,3 +10,5 @@ /*

* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.3.2
*/
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lill=e()}}(function(){return function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t){"use strict";var n,r,o,i,a,c,s,u,l,f,p,d,b,y,m,v,h,x,g;r=e("es6-symbol"),a=r("lill related data"),c=r("lill owner of item"),i=function(e){var t,n;if(!e||"object"!=(n=typeof e)&&"function"!==n)throw new TypeError("LiLL.attach needs an object or function");if(e[a])throw new TypeError("LiLL.attach cannot use already attached object");if(!Object.isExtensible(e))throw new TypeError("LiLL.attach needs extensible object");return e[a]=t={owner:r("lill parent owner"),next:r("lill next item"),prev:r("lill previous item"),head:null,tail:null,size:0},Object.seal(t),e},f=function(e){return e[a]?(l(e),delete e[a],e):e},o=function(e,t){var n;return n=s(e),u(e,t,"add"),t[n.owner]===e?e:(t[n.next]=t[n.prev]=null,t[n.owner]=e,n.head?(n.tail[n.next]=t,t[n.prev]=n.tail,n.tail=t):n.head=n.tail=t,n.size+=1,e)},h=function(e,t){var n;return n=s(e),u(e,t,"has"),t[n.owner]===e},g=function(e,t){var n,r,o;return n=s(e),u(e,t,"remove"),t[n.owner]!==e?e:(n.head===t&&(n.head=n.head[n.next]),n.tail===t&&(n.tail=n.tail[n.prev]),(o=t[n.prev])&&(o[n.next]=t[n.next]),(r=t[n.next])&&(r[n.prev]=t[n.prev]),delete t[n.next],delete t[n.prev],delete t[n.owner],n.size-=1,e)},l=function(e){var t,n;for(t=s(e);n=t.head;)t.head=n[t.next],delete n[t.next],delete n[t.prev],delete n[t.owner];return t.head=t.tail=null,t.size=0,e},d=function(e){var t;return t=s(e),t.head},v=function(e){var t;return t=s(e),t.tail},b=function(e,t){var n;return n=s(e),null!=t?t[n.next]:void 0},y=function(e,t){var n;return n=s(e),null!=t?t[n.prev]:void 0},m=function(e){var t;return t=s(e),t.size},p=function(e,t,n){var r,o,i,a;if(r=s(e),"function"!=typeof t)throw new TypeError("LiLL.each method expects callback function");if(i=r.head){for(o=0,n||(n=t),a=[];;){if(t.call(n,i,o++),i=i[r.next],!i)break;a.push(void 0)}return a}},x=function(e){return null!=e[a]},s=function(e){var t;if(t=null!=e?e[a]:void 0)return t;throw new TypeError("use LiLL.attach() method on owner object")},u=function(e,t,n){var r;if(!t||"object"!=(r=typeof t)&&"function"!==r)throw new TypeError("LiLL."+n+" needs an object or function to be added");if(!Object.isExtensible(t))throw new TypeError("LiLL."+n+" method needs an extensible item");if(t[c]&&t[c]!==e)throw new TypeError("LiLL cannot "+n+" item that is managed by another list")},n={attach:i,detach:f,add:o,has:h,remove:g,clear:l,getHead:d,getTail:v,getNext:b,getPrevious:y,getSize:m,each:p,isAttached:x},t.exports=Object.freeze(n)},{"es6-symbol":2}],2:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Symbol:e("./polyfill")},{"./is-implemented":3,"./polyfill":17}],3:[function(e,t){"use strict";t.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{if("Symbol (test symbol)"!==String(e))return!1}catch(t){return!1}return"symbol"==typeof Symbol.iterator?!0:"object"!=typeof Symbol.isConcatSpreadable?!1:"object"!=typeof Symbol.isRegExp?!1:"object"!=typeof Symbol.iterator?!1:"object"!=typeof Symbol.toPrimitive?!1:"object"!=typeof Symbol.toStringTag?!1:"object"!=typeof Symbol.unscopables?!1:!0}},{}],4:[function(e,t){"use strict";var n,r=e("es5-ext/object/assign"),o=e("es5-ext/object/normalize-options"),i=e("es5-ext/object/is-callable"),a=e("es5-ext/string/#/contains");n=t.exports=function(e,t){var n,i,c,s,u;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],null==e?(n=c=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),c=a.call(e,"w")),u={value:t,configurable:n,enumerable:i,writable:c},s?r(o(s),u):u},n.gs=function(e,t,n){var c,s,u,l;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(c=!0,s=!1):(c=a.call(e,"c"),s=a.call(e,"e")),l={get:t,set:n,configurable:c,enumerable:s},u?r(o(u),l):l}},{"es5-ext/object/assign":5,"es5-ext/object/is-callable":8,"es5-ext/object/normalize-options":12,"es5-ext/string/#/contains":14}],5:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":6,"./shim":7}],6:[function(e,t){"use strict";t.exports=function(){var e,t=Object.assign;return"function"!=typeof t?!1:(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],7:[function(e,t){"use strict";var n=e("../keys"),r=e("../valid-value"),o=Math.max;t.exports=function(e,t){var i,a,c,s=o(arguments.length,2);for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(r){i||(i=r)}},a=1;s>a;++a)t=arguments[a],n(t).forEach(c);if(void 0!==i)throw i;return e}},{"../keys":9,"../valid-value":13}],8:[function(e,t){"use strict";t.exports=function(e){return"function"==typeof e}},{}],9:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Object.keys:e("./shim")},{"./is-implemented":10,"./shim":11}],10:[function(e,t){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],11:[function(e,t){"use strict";var n=Object.keys;t.exports=function(e){return n(null==e?e:Object(e))}},{}],12:[function(e,t){"use strict";var n,r=e("./assign"),o=Array.prototype.forEach,i=Object.create,a=Object.getPrototypeOf;n=function(e,t){var o=a(e);return r(o?n(o,t):t,e)},t.exports=function(){var e=i(null);return o.call(arguments,function(t){null!=t&&n(Object(t),e)}),e}},{"./assign":5}],13:[function(e,t){"use strict";t.exports=function(e){if(null==e)throw new TypeError("Cannot use null or undefined");return e}},{}],14:[function(e,t){"use strict";t.exports=e("./is-implemented")()?String.prototype.contains:e("./shim")},{"./is-implemented":15,"./shim":16}],15:[function(e,t){"use strict";var n="razdwatrzy";t.exports=function(){return"function"!=typeof n.contains?!1:n.contains("dwa")===!0&&n.contains("foo")===!1}},{}],16:[function(e,t){"use strict";var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}},{}],17:[function(e,t){"use strict";var n,r,o=e("d"),i=Object.create,a=Object.defineProperties;n=function(){var e=i(null);return function(t){for(var n=0;e[t+(n||"")];)++n;return t+=n||"",e[t]=!0,"@@"+t}}(),t.exports=r=function(e){var t;if(this instanceof r)throw new TypeError("TypeError: Symbol is not a constructor");return t=i(r.prototype),e=void 0===e?"":String(e),a(t,{__description__:o("",e),__name__:o("",n(e))})},Object.defineProperties(r,{create:o("",r("create")),hasInstance:o("",r("hasInstance")),isConcatSpreadable:o("",r("isConcatSpreadable")),isRegExp:o("",r("isRegExp")),iterator:o("",r("iterator")),toPrimitive:o("",r("toPrimitive")),toStringTag:o("",r("toStringTag")),unscopables:o("",r("unscopables"))}),a(r.prototype,{properToString:o(function(){return"Symbol ("+this.__description__+")"}),toString:o("",function(){return this.__name__})}),Object.defineProperty(r.prototype,r.toPrimitive,o("",function(){throw new TypeError("Conversion of symbol objects is not allowed")})),Object.defineProperty(r.prototype,r.toStringTag,o("c","Symbol"))},{d:4}]},{},[1])(1)});
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.lill=e()}}(function(){return function e(t,n,r){function o(a,c){if(!n[a]){if(!t[a]){var s="function"==typeof require&&require;if(!c&&s)return s(a,!0);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[a]={exports:{}};t[a][0].call(l.exports,function(e){var n=t[a][1][e];return o(n?n:e)},l,l.exports,e,t,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a<r.length;a++)o(r[a]);return o}({1:[function(e,t){"use strict";var n,r,o,i,a,c,s,u,l,f,p,d,b,y,m,v,h,x,g,w,j,S;r=e("es6-symbol"),a=r("lill related data"),c=r("lill owner of item"),w=0,i=function(e){var t,n;if(!e||"object"!=(n=typeof e)&&"function"!==n)throw new TypeError("LiLL.attach needs an object or function");if(e[a])throw new TypeError("LiLL.attach cannot use already attached object");if(!Object.isExtensible(e))throw new TypeError("LiLL.attach needs extensible object");return e[a]=t={owner:r("lill parent owner"),next:r("lill next item"),prev:r("lill previous item"),head:null,tail:null,size:0,id:w},w+=1,Object.seal(t),e},f=function(e){return e[a]?(l(e),delete e[a],e):e},o=function(e,t){var n;return n=s(e),u(e,t,"add"),t[n.owner]===e?e:(t[n.next]=t[n.prev]=null,t[n.owner]=e,n.head?(n.tail[n.next]=t,t[n.prev]=n.tail,n.tail=t):n.head=n.tail=t,n.size+=1,e)},g=function(e,t){var n;return n=s(e),u(e,t,"has"),t[n.owner]===e},S=function(e,t){var n,r,o;return n=s(e),u(e,t,"remove"),t[n.owner]!==e?e:(n.head===t&&(n.head=n.head[n.next]),n.tail===t&&(n.tail=n.tail[n.prev]),(o=t[n.prev])&&(o[n.next]=t[n.next]),(r=t[n.next])&&(r[n.prev]=t[n.prev]),delete t[n.next],delete t[n.prev],delete t[n.owner],n.size-=1,e)},l=function(e){var t,n;for(t=s(e);n=t.head;)t.head=n[t.next],delete n[t.next],delete n[t.prev],delete n[t.owner];return t.head=t.tail=null,t.size=0,e},y=function(e){var t;return t=s(e),t.head},x=function(e){var t;return t=s(e),t.tail},m=function(e,t){var n;return n=s(e),null!=t?t[n.next]:void 0},v=function(e,t){var n;return n=s(e),null!=t?t[n.prev]:void 0},h=function(e){var t;return t=s(e),t.size},p=function(e,t,n){var r,o,i,a,c;if(r=s(e),"function"!=typeof t)throw new TypeError("LiLL.each method expects callback function");if(o=0,!(i=r.head))return o;for(a=void 0!==n?b:d;;){if(c=i[r.next],a(t,i,o,n),!(i=c))break;o+=1}return o},d=function(e,t,n){return e(t,n)},b=function(e,t,n,r){return e.call(r,t,n)},j=function(e){return null!=e[a]},s=function(e){var t;if(t=null!=e?e[a]:void 0)return t;throw new TypeError("use LiLL.attach() method on owner object")},u=function(e,t,n){var r;if(!t||"object"!=(r=typeof t)&&"function"!==r)throw new TypeError("LiLL."+n+" needs an object or function to be added");if(!Object.isExtensible(t))throw new TypeError("LiLL."+n+" method needs an extensible item");if(t[c]&&t[c]!==e)throw new TypeError("LiLL cannot "+n+" item that is managed by another list")},n={attach:i,detach:f,add:o,has:g,remove:S,clear:l,getHead:y,getTail:x,getNext:m,getPrevious:v,getSize:h,each:p,isAttached:j},t.exports=Object.freeze(n)},{"es6-symbol":2}],2:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Symbol:e("./polyfill")},{"./is-implemented":3,"./polyfill":17}],3:[function(e,t){"use strict";t.exports=function(){var e;if("function"!=typeof Symbol)return!1;e=Symbol("test symbol");try{if("Symbol (test symbol)"!==String(e))return!1}catch(t){return!1}return"symbol"==typeof Symbol.iterator?!0:"object"!=typeof Symbol.isConcatSpreadable?!1:"object"!=typeof Symbol.isRegExp?!1:"object"!=typeof Symbol.iterator?!1:"object"!=typeof Symbol.toPrimitive?!1:"object"!=typeof Symbol.toStringTag?!1:"object"!=typeof Symbol.unscopables?!1:!0}},{}],4:[function(e,t){"use strict";var n,r=e("es5-ext/object/assign"),o=e("es5-ext/object/normalize-options"),i=e("es5-ext/object/is-callable"),a=e("es5-ext/string/#/contains");n=t.exports=function(e,t){var n,i,c,s,u;return arguments.length<2||"string"!=typeof e?(s=t,t=e,e=null):s=arguments[2],null==e?(n=c=!0,i=!1):(n=a.call(e,"c"),i=a.call(e,"e"),c=a.call(e,"w")),u={value:t,configurable:n,enumerable:i,writable:c},s?r(o(s),u):u},n.gs=function(e,t,n){var c,s,u,l;return"string"!=typeof e?(u=n,n=t,t=e,e=null):u=arguments[3],null==t?t=void 0:i(t)?null==n?n=void 0:i(n)||(u=n,n=void 0):(u=t,t=n=void 0),null==e?(c=!0,s=!1):(c=a.call(e,"c"),s=a.call(e,"e")),l={get:t,set:n,configurable:c,enumerable:s},u?r(o(u),l):l}},{"es5-ext/object/assign":5,"es5-ext/object/is-callable":8,"es5-ext/object/normalize-options":12,"es5-ext/string/#/contains":14}],5:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":6,"./shim":7}],6:[function(e,t){"use strict";t.exports=function(){var e,t=Object.assign;return"function"!=typeof t?!1:(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],7:[function(e,t){"use strict";var n=e("../keys"),r=e("../valid-value"),o=Math.max;t.exports=function(e,t){var i,a,c,s=o(arguments.length,2);for(e=Object(r(e)),c=function(n){try{e[n]=t[n]}catch(r){i||(i=r)}},a=1;s>a;++a)t=arguments[a],n(t).forEach(c);if(void 0!==i)throw i;return e}},{"../keys":9,"../valid-value":13}],8:[function(e,t){"use strict";t.exports=function(e){return"function"==typeof e}},{}],9:[function(e,t){"use strict";t.exports=e("./is-implemented")()?Object.keys:e("./shim")},{"./is-implemented":10,"./shim":11}],10:[function(e,t){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(e){return!1}}},{}],11:[function(e,t){"use strict";var n=Object.keys;t.exports=function(e){return n(null==e?e:Object(e))}},{}],12:[function(e,t){"use strict";var n,r=e("./assign"),o=Array.prototype.forEach,i=Object.create,a=Object.getPrototypeOf;n=function(e,t){var o=a(e);return r(o?n(o,t):t,e)},t.exports=function(){var e=i(null);return o.call(arguments,function(t){null!=t&&n(Object(t),e)}),e}},{"./assign":5}],13:[function(e,t){"use strict";t.exports=function(e){if(null==e)throw new TypeError("Cannot use null or undefined");return e}},{}],14:[function(e,t){"use strict";t.exports=e("./is-implemented")()?String.prototype.contains:e("./shim")},{"./is-implemented":15,"./shim":16}],15:[function(e,t){"use strict";var n="razdwatrzy";t.exports=function(){return"function"!=typeof n.contains?!1:n.contains("dwa")===!0&&n.contains("foo")===!1}},{}],16:[function(e,t){"use strict";var n=String.prototype.indexOf;t.exports=function(e){return n.call(this,e,arguments[1])>-1}},{}],17:[function(e,t){"use strict";var n,r,o=e("d"),i=Object.create,a=Object.defineProperties;n=function(){var e=i(null);return function(t){for(var n=0;e[t+(n||"")];)++n;return t+=n||"",e[t]=!0,"@@"+t}}(),t.exports=r=function(e){var t;if(this instanceof r)throw new TypeError("TypeError: Symbol is not a constructor");return t=i(r.prototype),e=void 0===e?"":String(e),a(t,{__description__:o("",e),__name__:o("",n(e))})},Object.defineProperties(r,{create:o("",r("create")),hasInstance:o("",r("hasInstance")),isConcatSpreadable:o("",r("isConcatSpreadable")),isRegExp:o("",r("isRegExp")),iterator:o("",r("iterator")),toPrimitive:o("",r("toPrimitive")),toStringTag:o("",r("toStringTag")),unscopables:o("",r("unscopables"))}),a(r.prototype,{properToString:o(function(){return"Symbol ("+this.__description__+")"}),toString:o("",function(){return this.__name__})}),Object.defineProperty(r.prototype,r.toPrimitive,o("",function(){throw new TypeError("Conversion of symbol objects is not allowed")})),Object.defineProperty(r.prototype,r.toStringTag,o("c","Symbol"))},{d:4}]},{},[1])(1)});

@@ -10,5 +10,7 @@ /*

* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.3.2
*/
'use strict';
var LiLL, Symbol, add, attach, bData, bOwner, checkAttached, checkItem, clear, detach, each, getHead, getNext, getPrevious, getSize, getTail, has, isAttached, remove;
var LiLL, Symbol, add, attach, bData, bOwner, checkAttached, checkItem, clear, detach, each, each$noContext, each$withContext, getHead, getNext, getPrevious, getSize, getTail, has, idSequence, isAttached, remove;

@@ -21,2 +23,4 @@ Symbol = require('es6-symbol');

idSequence = 0;
attach = function(owner) {

@@ -39,4 +43,6 @@ var data, _ref;

tail: null,
size: 0
size: 0,
id: idSequence
};
idSequence += 1;
Object.seal(data);

@@ -153,3 +159,3 @@ return owner;

each = function(owner, cb, ctx) {
var data, i, item, _results;
var data, i, item, iterator, next;
data = checkAttached(owner);

@@ -159,20 +165,26 @@ if (typeof cb !== 'function') {

}
i = 0;
if (!(item = data.head)) {
return;
return i;
}
i = 0;
ctx || (ctx = cb);
_results = [];
iterator = ctx !== void 0 ? each$withContext : each$noContext;
while (true) {
cb.call(ctx, item, i++);
item = item[data.next];
if (!item) {
next = item[data.next];
iterator(cb, item, i, ctx);
if (!(item = next)) {
break;
} else {
_results.push(void 0);
}
i += 1;
}
return _results;
return i;
};
each$noContext = function(fn, item, i) {
return fn(item, i);
};
each$withContext = function(fn, item, i, ctx) {
return fn.call(ctx, item, i);
};
isAttached = function(owner) {

@@ -179,0 +191,0 @@ return owner[bData] != null;

@@ -10,3 +10,5 @@ /*

* THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Version: 0.3.2
*/
"use strict";var e,t,a,r,n,c,i,o,h,l,d,u,s,b,f,v,L,w,m;t=require("es6-symbol"),n=t("lill related data"),c=t("lill owner of item"),r=function(e){var a,r;if(!e||"object"!=(r=typeof e)&&"function"!==r)throw new TypeError("LiLL.attach needs an object or function");if(e[n])throw new TypeError("LiLL.attach cannot use already attached object");if(!Object.isExtensible(e))throw new TypeError("LiLL.attach needs extensible object");return e[n]=a={owner:t("lill parent owner"),next:t("lill next item"),prev:t("lill previous item"),head:null,tail:null,size:0},Object.seal(a),e},l=function(e){return e[n]?(h(e),delete e[n],e):e},a=function(e,t){var a;return a=i(e),o(e,t,"add"),t[a.owner]===e?e:(t[a.next]=t[a.prev]=null,t[a.owner]=e,a.head?(a.tail[a.next]=t,t[a.prev]=a.tail,a.tail=t):a.head=a.tail=t,a.size+=1,e)},L=function(e,t){var a;return a=i(e),o(e,t,"has"),t[a.owner]===e},m=function(e,t){var a,r,n;return a=i(e),o(e,t,"remove"),t[a.owner]!==e?e:(a.head===t&&(a.head=a.head[a.next]),a.tail===t&&(a.tail=a.tail[a.prev]),(n=t[a.prev])&&(n[a.next]=t[a.next]),(r=t[a.next])&&(r[a.prev]=t[a.prev]),delete t[a.next],delete t[a.prev],delete t[a.owner],a.size-=1,e)},h=function(e){var t,a;for(t=i(e);a=t.head;)t.head=a[t.next],delete a[t.next],delete a[t.prev],delete a[t.owner];return t.head=t.tail=null,t.size=0,e},u=function(e){var t;return t=i(e),t.head},v=function(e){var t;return t=i(e),t.tail},s=function(e,t){var a;return a=i(e),null!=t?t[a.next]:void 0},b=function(e,t){var a;return a=i(e),null!=t?t[a.prev]:void 0},f=function(e){var t;return t=i(e),t.size},d=function(e,t,a){var r,n,c,o;if(r=i(e),"function"!=typeof t)throw new TypeError("LiLL.each method expects callback function");if(c=r.head){for(n=0,a||(a=t),o=[];;){if(t.call(a,c,n++),c=c[r.next],!c)break;o.push(void 0)}return o}},w=function(e){return null!=e[n]},i=function(e){var t;if(t=null!=e?e[n]:void 0)return t;throw new TypeError("use LiLL.attach() method on owner object")},o=function(e,t,a){var r;if(!t||"object"!=(r=typeof t)&&"function"!==r)throw new TypeError("LiLL."+a+" needs an object or function to be added");if(!Object.isExtensible(t))throw new TypeError("LiLL."+a+" method needs an extensible item");if(t[c]&&t[c]!==e)throw new TypeError("LiLL cannot "+a+" item that is managed by another list")},e={attach:r,detach:l,add:a,has:L,remove:m,clear:h,getHead:u,getTail:v,getNext:s,getPrevious:b,getSize:f,each:d,isAttached:w},module.exports=Object.freeze(e);
"use strict";var e,t,a,n,r,c,i,o,h,l,d,u,f,s,b,v,w,L,x,m,p,g;t=require("es6-symbol"),r=t("lill related data"),c=t("lill owner of item"),m=0,n=function(e){var a,n;if(!e||"object"!=(n=typeof e)&&"function"!==n)throw new TypeError("LiLL.attach needs an object or function");if(e[r])throw new TypeError("LiLL.attach cannot use already attached object");if(!Object.isExtensible(e))throw new TypeError("LiLL.attach needs extensible object");return e[r]=a={owner:t("lill parent owner"),next:t("lill next item"),prev:t("lill previous item"),head:null,tail:null,size:0,id:m},m+=1,Object.seal(a),e},l=function(e){return e[r]?(h(e),delete e[r],e):e},a=function(e,t){var a;return a=i(e),o(e,t,"add"),t[a.owner]===e?e:(t[a.next]=t[a.prev]=null,t[a.owner]=e,a.head?(a.tail[a.next]=t,t[a.prev]=a.tail,a.tail=t):a.head=a.tail=t,a.size+=1,e)},x=function(e,t){var a;return a=i(e),o(e,t,"has"),t[a.owner]===e},g=function(e,t){var a,n,r;return a=i(e),o(e,t,"remove"),t[a.owner]!==e?e:(a.head===t&&(a.head=a.head[a.next]),a.tail===t&&(a.tail=a.tail[a.prev]),(r=t[a.prev])&&(r[a.next]=t[a.next]),(n=t[a.next])&&(n[a.prev]=t[a.prev]),delete t[a.next],delete t[a.prev],delete t[a.owner],a.size-=1,e)},h=function(e){var t,a;for(t=i(e);a=t.head;)t.head=a[t.next],delete a[t.next],delete a[t.prev],delete a[t.owner];return t.head=t.tail=null,t.size=0,e},s=function(e){var t;return t=i(e),t.head},L=function(e){var t;return t=i(e),t.tail},b=function(e,t){var a;return a=i(e),null!=t?t[a.next]:void 0},v=function(e,t){var a;return a=i(e),null!=t?t[a.prev]:void 0},w=function(e){var t;return t=i(e),t.size},d=function(e,t,a){var n,r,c,o,h;if(n=i(e),"function"!=typeof t)throw new TypeError("LiLL.each method expects callback function");if(r=0,!(c=n.head))return r;for(o=void 0!==a?f:u;;){if(h=c[n.next],o(t,c,r,a),!(c=h))break;r+=1}return r},u=function(e,t,a){return e(t,a)},f=function(e,t,a,n){return e.call(n,t,a)},p=function(e){return null!=e[r]},i=function(e){var t;if(t=null!=e?e[r]:void 0)return t;throw new TypeError("use LiLL.attach() method on owner object")},o=function(e,t,a){var n;if(!t||"object"!=(n=typeof t)&&"function"!==n)throw new TypeError("LiLL."+a+" needs an object or function to be added");if(!Object.isExtensible(t))throw new TypeError("LiLL."+a+" method needs an extensible item");if(t[c]&&t[c]!==e)throw new TypeError("LiLL cannot "+a+" item that is managed by another list")},e={attach:n,detach:l,add:a,has:x,remove:g,clear:h,getHead:s,getTail:L,getNext:b,getPrevious:v,getSize:w,each:d,isAttached:p},module.exports=Object.freeze(e);
{
"name": "lill",
"description": "Lightweight linked list implementation with small memory footprint.",
"version": "0.3.1",
"version": "0.3.2",
"license": "MIT",

@@ -6,0 +6,0 @@ "keywords": [

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