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

litejs

Package Overview
Dependencies
Maintainers
1
Versions
214
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

litejs - npm Package Compare versions

Comparing version 0.0.14 to 0.0.15

12

litejs-src.js

@@ -6,4 +6,4 @@ /*!litejs.com/MIT-LICENSE.txt*/

/*
* @version 0.1.3
* @date 2014-01-24
* @version 0.1.4
* @date 2014-02-07
* @stability 2 - Unstable

@@ -153,2 +153,10 @@ * @author Lauri Rooden <lauri@rooden.ee>

O.clone = function(obj, temp, key) {
if(!obj || typeof obj != "object") return obj
temp = new obj.constructor(obj); // changed
for (key in obj) if (obj.hasOwnProperty(key)) temp[key] = O.clone(obj[key])
return temp
}
O.deepMerge = function(target, source, path, changed, key, val) {

@@ -155,0 +163,0 @@ path = path || ""

40

litejs.js
/*!litejs.com/MIT-LICENSE.txt*/
function Nop(){}function True(){return!0}function False(){return!1}function This(){return this}function Init(){return this.init&&this.init.apply(this,arguments)||this}
!function(n){function h(c){if(h[c])return h[c];for(var b="_",a=c,e=c.split("->");1<e.length;)a=e.pop(),b=e.pop().match(/\w+/g)||"",e.length&&e.push("(function("+b+"){return("+a+")})");return h[c]=new Function(b,"return("+a+")")}var l=Array.prototype,k=Function.prototype,p=String.prototype,d=Object,g=k.call.bind(l.slice),f=[];k.construct=function(c){var b=c.length;return b?(f[b]||(f[b]=h("t a->new t(a["+Object.keys(g(c)).join("],a[")+"])")))(this,c):new this};k.partial=function(){var c=this,b=g(arguments);
return function(){return c.apply(this,b.concat.apply(b,arguments))}};k.byWords=function(c){var b=this;c|=0;return function(){var a=this,e=a,m=arguments;(m[c]||"").replace(/[-\w]+/g,function(d){m[c]=d;e=b.apply(a,m)});return e}};k.byKeyVal=function(){var c=this;return function(b){var a,e=g(arguments);if("object"==typeof b)for(a in b)e[0]=a,e[1]=b[a],a=c.apply(this,e);else a=c.apply(this,e);return a}};k.cache=function(c,b,a){var e=this,m=a||{},d=function(){var a=arguments,f=!!c||this instanceof d,g=
b?b(a,e):f+":"+a.length+":"+l.join.call(a);return g in m?m[g]:m[g]=f?e.construct(a):e.apply(this,a)};d.origin=e;d.cached=m;d.extend=function(){return e.extend.apply(e,arguments).cache(c,b,a)};d.prototype=e.prototype;return d};k.extend=function(){var c,b=this,a=0,e=function(){return b.apply(this,arguments)};e.prototype=Object.create(b.prototype);for(e.prototype.constructor=e;c=arguments[a++];)Object.merge(e.prototype,c);return e};k.ttl=function(c,b){var a=this,e=setTimeout(function(){c=0;b&&b()},c);
return function(){clearTimeout(e);c&&a.apply(null,arguments)}};k.once=function(c){var b,a,e=this;return function(){clearTimeout(b);a=arguments;b=setTimeout(function(){e.apply(null,a)},c)}};k.rate=function(c,b){var a,e,m=this,d=0;return function(){var f=+new Date;clearTimeout(a);f>d?(d=f+c,m.apply(null,arguments)):b&&(e=arguments,a=setTimeout(function(){m.apply(null,e)},d-f))}};d.each=function(c,b,a,e){if(c)for(e in c)c.hasOwnProperty(e)&&b.call(a,c[e],e,c)};d.merge=function(c,b){for(var a,e,m=1;e=
arguments[m++];)for(a in e)e.hasOwnProperty(a)&&(c[a]=e[a]);return c};d.deepMerge=function(c,b,a,e,m,f){a=a||"";e=e||[];for(m in b)b.hasOwnProperty(m)&&c[m]!==b[m]&&(f=b[m],e.push(a+m),null===f?delete c[m]:"object"==typeof f&&c[m]&&"object"==typeof c[m]?d.deepMerge(c[m],f,a+m+".",e):c[m]=f);return e};d.zip=function(c,b){return c.fold(function(a,e,c){a[e]=b[c];return a},{})};l.remove=function(){for(var c=this.length,b=g(arguments),a=-1;c--;)~b.indexOf(this[c])&&this.splice(a=c,1);return a};l.each=
l.forEach;l.fold=l.reduce;l.foldr=l.reduceRight;l.unique=l.filter.partial(function(c,b,a){return b==a.lastIndexOf(c)});!function(c){k[c]=p[c]=function(){var b=arguments,a=b[0];b[0]=this.fn();return l[c].apply(a,b)}}.byWords()("every filter each map fold foldr some");k.fn=This;p.fn=function(){return h(this)};n.Fn=h}(this);
!function(n,h,l){function k(a,e){var b,f={};a=a.replace(c,function(a,e,b,c){f["."==e?(e="class",f[e]&&(b=f[e]+" "+b),e):"#"==e?"id":b]=c||b;return""})||"div";b=(d[a]||(d[a]=h.createElement(a))).cloneNode(!0).set(f);return g[a]&&g[a](b,e)||b.set(e)}function p(a,e,b){if(a)for(b in e=k[l],e)a[b]=e[b];return a}var d={},g={},f=(n.HTMLElement||n.Element||k)[l],c=/([.#:[])([-\w]+)(?:=([-\w]+)])?]?/g;f.append=function(a,e){if(a){if("string"==typeof a||"number"==typeof a)a=k.text(a);else if(!("nodeType"in
a)&&"length"in a){for(var b=a.length,c=0,d=h.createDocumentFragment();c<b;)this.append.call(d,a[c++]);a=d}a.nodeType&&this.insertBefore(a,(!0===e?this.firstChild:"number"==typeof e?this.childNodes[0>e?this.childNodes.length-e-2:e]:e)||null);a.append_hook&&a.append_hook()}return this};f.after=function(a,b){a.parentNode.append(this,b?a:a.nextSibling);return this};f.to=function(a,b){a.append(this,b);return this};f.hasClass=function(a){return RegExp("\\b"+a+"\\b").test(this.className)};f.addClass=function(a){this.className+=
""==this.className?a:this.hasClass(a)?"":" "+a;return this};f.rmClass=function(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this};f.toggleClass=function(a,b){1==arguments.length&&(b=!this.hasClass(a));this[b?"addClass":"rmClass"](a);return b};f.empty=function(){for(var a;a=this.firstChild;)this.kill.call(a);return this};f.kill=function(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&&Event.removeAll(this);this.kill_hook&&this.kill_hook();this.empty&&
this.empty();return this};f.on=function(a,b){Event.add(this,a,b);return this};f.non=function(a,b){Event.remove(this,a,b);return this};f.set=function(a){var b=typeof a,c;if(a)if("string"==b||"number"==b||a.nodeType||"length"in a)this.append(a);else for(b in a)c=a[b],"class"==b?this.addClass(c):"string"==typeof c?(this.setAttribute(b,c),"name"==b&&"\v"=="v"&&this.mergeAttributes(h.createElement("<INPUT name='"+b+"'/>"),!1)):c?this[b]=c:this.removeAttribute(b);return this};f._find=function(a){var b=
0,d=["_"];a=a.replace(c,function(a,b,e,c){d.push("."==b?"(' '+_.className+' ').indexOf(' "+e+" ')>-1":"#"==b?"_.id=='"+e+"'":"_.getAttribute('"+e+"')"+(c?"=='"+c+"'":""));return""})||"*";for(var f=this.getElementsByTagName(a),g=Function("_","return "+d.join("&&"));a=f[b++];)if(g(a))return a.to?a:p(a)};f.find=h.querySelector?function(a){return this.querySelector(a)}:f._find;if(f===k[l]){var b=h.createElement;h.createElement=function(a){return p(b(a))};p(h.body)}k[l]=f;k.get=function(a){"string"==typeof a&&
(a=h.getElementById(a));return a&&a.to?a:p(a)};k.cache=function(a,b,c){d[a]="string"==typeof b?k(b):b;c&&(g[a]=c)};k.cache.el=d;k.cache.fn=g;k.text=function(a){return h.createTextNode(a)};n.El=k}(this,document,"prototype");
!function(n){function h(b,a,e,c,d){d=a(e,c,d);e[b](p+("wheel"==c?f:c),d,!1);return l}var l=n.Event||(n.Event={}),k=120,p="",d="addEventListener",g="removeEventListener",f="onwheel"in n?"wheel":"onmousewheel"in n?"mousewheel":"DOMMouseScroll",c=l.Emitter={on:function(b,a,e){var c=this._e||(this._e={});(c[b]||(c[b]=[])).push([a,e]);return this},non:function(b,a){if(b){if(this._e&&this._e[b]&&a)for(var c=this._e[b],d=c.length;d--;)c[d][0]==a?c.splice(d,1):delete this._e[b]}else delete this._e;return this},
once:function(b,a,c){return this.on(b,a,c).on(b,this.non.bind(this,b,a))},emit:function(b){if(this._e&&this._e[b])for(var a=0,c=this._e[b],d=c.slice.call(arguments,1);b=c[a++];)b[0].apply(b[1]||this,d);return this}};c.off=c.non;n[d]||(p="on",d="attachEvent",g="detachEvent");l.add=h.bind(null,d,function(b,a,e){var d="wheel"==a?function(a){a||(a=n.event);var c=(a.wheelDelta||-a.detail||-a.deltaY)/k;if(0!=c){if(1>c&&-1<c){var d=(0>c?-1:1)/c,c=c*d;k/=d}e.call(b,a,c)}}:p?function(){e.call(b,n.event)}:
e;d!=e&&(d.origin=e);c.on.call(b,a,d,b);return d});l.remove=h.bind(null,g,function(b,a,c){if(c&&b._e&&b._e[a]){a=b._e[a];for(var d=0;b=a[d];d++)if(b=b[0],b==c||b.origin==c)return a.splice(d,1),b}});l.stop=function(b){b.stopPropagation&&b.stopPropagation();b.preventDefault&&b.preventDefault();b.cancelBubble=b.cancel=!0;return b.returnValue=!1};l.removeAll=function(b,a,c,d,f){if(b._e)for(c in b._e)if(!a||c==a)for(d=b._e[c],f=d.length;f--;)l.remove(b,c,d[0])}}(this);
!function(n,h,l){function k(a){a=f?e.pathname.slice(f.length):(a||e).href.split("#")[1]||"";a=decodeURIComponent(a.replace(/\+/g," "));return a.replace(m,"")}function p(a,c){a=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2F/gi,"/");if(f)l[c?"replaceState":"pushState"](null,null,f+a);else if(e[c?"replace":"assign"]("#"+a),b&&k()!==k(b.location))b.location[c?"replace":b.document.open().close(),"assign"]("#"+a);d()}function d(){c!=(c=k())&&g&&g(c)}var g,f,c,b,a,e=location,m=/^[#\/\!]+|[\s\/]+$/g,
q=!+"\v1"&&8>(h.documentMode||1);l.getUrl=k;l.setUrl=p;l.start=function(c,e){g||(e&&l.pushState?(f=e,n.onpopstate=d):"onhashchange"in n&&!q?n.onhashchange=d:(q&&(b=h.body.appendChild(h.createElement('<iframe class="hide" src="javascript:0" tabindex="-1" />')).contentWindow),a=k(),setInterval(function(){var c=k();b&&a===c&&(c=k(b.location));a!==c&&(a=c,b?p(c):d())},50)));g=c;d()}}(this,document,history);
!function(n){function h(){this.map={}}var l=/^:+|\?+$/g,k=/^$|\?$/;h.prototype={add:function(h,d){var g,f=0,c=h.replace(/\/+$/,"").split("/"),b={path:h,opts:"function"==typeof d?{next:d}:d||{}};for(h="";;++f){g=c[f]||"";k.test(g)&&(this.map[h]=this.map[h+"/"]=b);if(!g)break;g.match(l)&&((b.names||(b.names={}))[f]=g.replace(l,""),g=":?");h=h?h+"/"+g:g}},route:function(h,d){d="function"==typeof d?{next:d}:d||{};var g=this.map,f=g[h]||"";if(!f){for(var c=h.split("/"),b=0,a=c.length;b<a;++b){next=f?f+
"/"+c[b]:c[b];if(!g[next])if(next=f?f+"/:?":":?",g[next])(d.args||(d.args={}))[g[next].names[b]]=c[b];else break;f=next}f=g[f];c.slice(b).join("/")}f.opts.before&&f.opts.before.call(f,d);(d.next||f.opts.next).call(f,d);f.opts.after&&f.opts.after.call(f,d)}};n.Router=h}(this);
!function(n){function h(d,g,f,c){if(k[d])return k[d];if(!(this instanceof h))return new h(d,g,f,c);k[d]=this;p.add(d);g&&this.init.apply(this,arguments)}function l(d){h(this.path).show(d)}var k={},p=new Router;h.prototype={init:function(d,g,f,c){this.route=d;this.el=g;this.parent="string"==typeof f?h(f):f;this.selector=c;h.active==d&&this.show()},getEl:function(){var d=typeof this.el;"function"==d?this.el=this.el():"string"==d&&(this.el=El(this.el));return this.el},getContentEl:function(){return this.selector&&
!function(n){function h(c){if(h[c])return h[c];for(var b="_",a=c,f=c.split("->");1<f.length;)a=f.pop(),b=f.pop().match(/\w+/g)||"",f.length&&f.push("(function("+b+"){return("+a+")})");return h[c]=new Function(b,"return("+a+")")}var l=Array.prototype,k=Function.prototype,p=String.prototype,d=Object,g=k.call.bind(l.slice),e=[];k.construct=function(c){var b=c.length;return b?(e[b]||(e[b]=h("t a->new t(a["+Object.keys(g(c)).join("],a[")+"])")))(this,c):new this};k.partial=function(){var c=this,b=g(arguments);
return function(){return c.apply(this,b.concat.apply(b,arguments))}};k.byWords=function(c){var b=this;c|=0;return function(){var a=this,f=a,m=arguments;(m[c]||"").replace(/[-\w]+/g,function(d){m[c]=d;f=b.apply(a,m)});return f}};k.byKeyVal=function(){var c=this;return function(b){var a,f=g(arguments);if("object"==typeof b)for(a in b)f[0]=a,f[1]=b[a],a=c.apply(this,f);else a=c.apply(this,f);return a}};k.cache=function(c,b,a){var f=this,m=a||{},d=function(){var a=arguments,e=!!c||this instanceof d,g=
b?b(a,f):e+":"+a.length+":"+l.join.call(a);return g in m?m[g]:m[g]=e?f.construct(a):f.apply(this,a)};d.origin=f;d.cached=m;d.extend=function(){return f.extend.apply(f,arguments).cache(c,b,a)};d.prototype=f.prototype;return d};k.extend=function(){var c,b=this,a=0,f=function(){return b.apply(this,arguments)};f.prototype=Object.create(b.prototype);for(f.prototype.constructor=f;c=arguments[a++];)Object.merge(f.prototype,c);return f};k.ttl=function(c,b){var a=this,f=setTimeout(function(){c=0;b&&b()},c);
return function(){clearTimeout(f);c&&a.apply(null,arguments)}};k.once=function(c){var b,a,f=this;return function(){clearTimeout(b);a=arguments;b=setTimeout(function(){f.apply(null,a)},c)}};k.rate=function(c,b){var a,f,m=this,d=0;return function(){var e=+new Date;clearTimeout(a);e>d?(d=e+c,m.apply(null,arguments)):b&&(f=arguments,a=setTimeout(function(){m.apply(null,f)},d-e))}};d.each=function(c,b,a,f){if(c)for(f in c)c.hasOwnProperty(f)&&b.call(a,c[f],f,c)};d.merge=function(c,b){for(var a,f,m=1;f=
arguments[m++];)for(a in f)f.hasOwnProperty(a)&&(c[a]=f[a]);return c};d.clone=function(c,b,a){if(!c||"object"!=typeof c)return c;b=new c.constructor(c);for(a in c)c.hasOwnProperty(a)&&(b[a]=d.clone(c[a]));return b};d.deepMerge=function(c,b,a,f,m,e){a=a||"";f=f||[];for(m in b)b.hasOwnProperty(m)&&c[m]!==b[m]&&(e=b[m],f.push(a+m),null===e?delete c[m]:"object"==typeof e&&c[m]&&"object"==typeof c[m]?d.deepMerge(c[m],e,a+m+".",f):c[m]=e);return f};d.zip=function(c,b){return c.fold(function(a,f,c){a[f]=
b[c];return a},{})};l.remove=function(){for(var c=this.length,b=g(arguments),a=-1;c--;)~b.indexOf(this[c])&&this.splice(a=c,1);return a};l.each=l.forEach;l.fold=l.reduce;l.foldr=l.reduceRight;l.unique=l.filter.partial(function(c,b,a){return b==a.lastIndexOf(c)});!function(c){k[c]=p[c]=function(){var b=arguments,a=b[0];b[0]=this.fn();return l[c].apply(a,b)}}.byWords()("every filter each map fold foldr some");k.fn=This;p.fn=function(){return h(this)};n.Fn=h}(this);
!function(n,h,l){function k(a,f){var b,e={};a=a.replace(c,function(a,b,f,c){e["."==b?(b="class",e[b]&&(f=e[b]+" "+f),b):"#"==b?"id":f]=c||f;return""})||"div";b=(d[a]||(d[a]=h.createElement(a))).cloneNode(!0).set(e);return g[a]&&g[a](b,f)||b.set(f)}function p(a,b,c){if(a)for(c in b=k[l],b)a[c]=b[c];return a}var d={},g={},e=(n.HTMLElement||n.Element||k)[l],c=/([.#:[])([-\w]+)(?:=([-\w]+)])?]?/g;e.append=function(a,b){if(a){if("string"==typeof a||"number"==typeof a)a=k.text(a);else if(!("nodeType"in
a)&&"length"in a){for(var c=a.length,d=0,e=h.createDocumentFragment();d<c;)this.append.call(e,a[d++]);a=e}a.nodeType&&this.insertBefore(a,(!0===b?this.firstChild:"number"==typeof b?this.childNodes[0>b?this.childNodes.length-b-2:b]:b)||null);a.append_hook&&a.append_hook()}return this};e.after=function(a,b){a.parentNode.append(this,b?a:a.nextSibling);return this};e.to=function(a,b){a.append(this,b);return this};e.hasClass=function(a){return RegExp("\\b"+a+"\\b").test(this.className)};e.addClass=function(a){this.className+=
""==this.className?a:this.hasClass(a)?"":" "+a;return this};e.rmClass=function(a){this.className=(" "+this.className+" ").replace(" "+a+" "," ").trim();return this};e.toggleClass=function(a,b){1==arguments.length&&(b=!this.hasClass(a));this[b?"addClass":"rmClass"](a);return b};e.empty=function(){for(var a;a=this.firstChild;)this.kill.call(a);return this};e.kill=function(){this.parentNode&&this.parentNode.removeChild(this);Event.removeAll&&Event.removeAll(this);this.kill_hook&&this.kill_hook();this.empty&&
this.empty();return this};e.on=function(a,b){Event.add(this,a,b);return this};e.non=function(a,b){Event.remove(this,a,b);return this};e.set=function(a){var b=typeof a,c;if(a)if("string"==b||"number"==b||a.nodeType||"length"in a)this.append(a);else for(b in a)c=a[b],"class"==b?this.addClass(c):"string"==typeof c?(this.setAttribute(b,c),"name"==b&&"\v"=="v"&&this.mergeAttributes(h.createElement("<INPUT name='"+b+"'/>"),!1)):c?this[b]=c:this.removeAttribute(b);return this};e._find=function(a){var b=
0,d=["_"];a=a.replace(c,function(a,b,c,f){d.push("."==b?"(' '+_.className+' ').indexOf(' "+c+" ')>-1":"#"==b?"_.id=='"+c+"'":"_.getAttribute('"+c+"')"+(f?"=='"+f+"'":""));return""})||"*";for(var e=this.getElementsByTagName(a),g=Function("_","return "+d.join("&&"));a=e[b++];)if(g(a))return a.to?a:p(a)};e.find=h.querySelector?function(a){return this.querySelector(a)}:e._find;if(e===k[l]){var b=h.createElement;h.createElement=function(a){return p(b(a))};p(h.body)}k[l]=e;k.get=function(a){"string"==typeof a&&
(a=h.getElementById(a));return a&&a.to?a:p(a)};k.cache=function(a,b,c){d[a]="string"==typeof b?k(b):b;c&&(g[a]=c)};k.cache.el=d;k.cache.fn=g;k.text=function(b){return h.createTextNode(b)};n.El=k}(this,document,"prototype");
!function(n){function h(b,a,c,d,g){g=a(c,d,g);c[b](p+("wheel"==d?e:d),g,!1);return l}var l=n.Event||(n.Event={}),k=120,p="",d="addEventListener",g="removeEventListener",e="onwheel"in n?"wheel":"onmousewheel"in n?"mousewheel":"DOMMouseScroll",c=l.Emitter={on:function(b,a,c){var d=this._e||(this._e={});(d[b]||(d[b]=[])).push([a,c]);return this},non:function(b,a){if(b){if(this._e&&this._e[b]&&a)for(var c=this._e[b],d=c.length;d--;)c[d][0]==a?c.splice(d,1):delete this._e[b]}else delete this._e;return this},
once:function(b,a,c){return this.on(b,a,c).on(b,this.non.bind(this,b,a))},emit:function(b){if(this._e&&this._e[b])for(var a=0,c=this._e[b],d=c.slice.call(arguments,1);b=c[a++];)b[0].apply(b[1]||this,d);return this}};c.off=c.non;n[d]||(p="on",d="attachEvent",g="detachEvent");l.add=h.bind(null,d,function(b,a,d){var e="wheel"==a?function(a){a||(a=n.event);var c=(a.wheelDelta||-a.detail||-a.deltaY)/k;if(0!=c){if(1>c&&-1<c){var e=(0>c?-1:1)/c,c=c*e;k/=e}d.call(b,a,c)}}:p?function(){d.call(b,n.event)}:
d;e!=d&&(e.origin=d);c.on.call(b,a,e,b);return e});l.remove=h.bind(null,g,function(b,a,c){if(c&&b._e&&b._e[a]){a=b._e[a];for(var d=0;b=a[d];d++)if(b=b[0],b==c||b.origin==c)return a.splice(d,1),b}});l.stop=function(b){b.stopPropagation&&b.stopPropagation();b.preventDefault&&b.preventDefault();b.cancelBubble=b.cancel=!0;return b.returnValue=!1};l.removeAll=function(b,a,c,d,e){if(b._e)for(c in b._e)if(!a||c==a)for(d=b._e[c],e=d.length;e--;)l.remove(b,c,d[0])}}(this);
!function(n,h,l){function k(a){a=e?f.pathname.slice(e.length):(a||f).href.split("#")[1]||"";a=decodeURIComponent(a.replace(/\+/g," "));return a.replace(m,"")}function p(a,c){a=encodeURIComponent(a).replace(/%20/g,"+").replace(/%2F/gi,"/");if(e)l[c?"replaceState":"pushState"](null,null,e+a);else if(f[c?"replace":"assign"]("#"+a),b&&k()!==k(b.location))b.location[c?"replace":b.document.open().close(),"assign"]("#"+a);d()}function d(){c!=(c=k())&&g&&g(c)}var g,e,c,b,a,f=location,m=/^[#\/\!]+|[\s\/]+$/g,
q=!+"\v1"&&8>(h.documentMode||1);l.getUrl=k;l.setUrl=p;l.start=function(c,f){g||(f&&l.pushState?(e=f,n.onpopstate=d):"onhashchange"in n&&!q?n.onhashchange=d:(q&&(b=h.body.appendChild(h.createElement('<iframe class="hide" src="javascript:0" tabindex="-1" />')).contentWindow),a=k(),setInterval(function(){var c=k();b&&a===c&&(c=k(b.location));a!==c&&(a=c,b?p(c):d())},50)));g=c;d()}}(this,document,history);
!function(n){function h(){this.map={}}var l=/^:+|\?+$/g,k=/^$|\?$/;h.prototype={add:function(h,d){var g,e=0,c=h.replace(/\/+$/,"").split("/"),b={path:h,opts:"function"==typeof d?{next:d}:d||{}};for(h="";;++e){g=c[e]||"";k.test(g)&&(this.map[h]=this.map[h+"/"]=b);if(!g)break;g.match(l)&&((b.names||(b.names={}))[e]=g.replace(l,""),g=":?");h=h?h+"/"+g:g}},route:function(h,d){d="function"==typeof d?{next:d}:d||{};var g=this.map,e=g[h]||"";if(!e){for(var c=h.split("/"),b=0,a=c.length;b<a;++b){next=e?e+
"/"+c[b]:c[b];if(!g[next])if(next=e?e+"/:?":":?",g[next])(d.args||(d.args={}))[g[next].names[b]]=c[b];else break;e=next}e=g[e];c.slice(b).join("/")}e.opts.before&&e.opts.before.call(e,d);(d.next||e.opts.next).call(e,d);e.opts.after&&e.opts.after.call(e,d)}};n.Router=h}(this);
!function(n){function h(d,g,e,c){if(k[d])return k[d];if(!(this instanceof h))return new h(d,g,e,c);k[d]=this;p.add(d);g&&this.init.apply(this,arguments)}function l(d){h(this.path).show(d)}var k={},p=new Router;h.prototype={init:function(d,g,e,c){this.route=d;this.el=g;this.parent="string"==typeof e?h(e):e;this.selector=c;h.active==d&&this.show()},getEl:function(){var d=typeof this.el;"function"==d?this.el=this.el():"string"==d&&(this.el=El(this.el));return this.el},getContentEl:function(){return this.selector&&
this.getEl().find(this.selector)||this.getEl()},load:function(d){},show:function(d){h.active=this.route;this.el?(this.active&&this.close(),this.ping(d),h.active==this.route&&this.emit("show",d)):this.load(d)},close:function(d){var g=this.parent;this.active=!1;g&&(g.getContentEl().removeChild(this.getEl()),g.child=null);this.emit("close",d);this.child&&this.child.close()},ping:function(d){var g=this.parent;this.active=!0;g&&(g.child!=this&&(g.child&&g.child.close(),g.child=this,g.getContentEl().appendChild(this.getEl())),
g.ping(d));this.emit("ping",d)}};Object.merge(h.prototype,Event.Emitter);p.add("",{before:function(d){d.next=function(){p.route(h["default"],l)}}});h.route=function(d){p.route(d||history.getUrl(),l)};n.View=h}(this);
{
"name": "litejs",
"version": "0.0.14",
"version": "0.0.15",
"stability": 1,

@@ -26,2 +26,4 @@ "license": "MIT",

"dependencies": {
"functional-lite": "*",
"elements-lite": "*",
"date-format-lite": "*",

@@ -32,5 +34,3 @@ "browser-upgrade-lite": "*",

"router-lite": "*",
"view-lite": "*",
"elements-lite": "*",
"functional-lite": "*"
"view-lite": "*"
},

@@ -37,0 +37,0 @@ "devDependencies": {

[npm-package]: https://npmjs.org/package/litejs
@version 0.0.14
@date 2014-01-24
@version 0.0.15
@date 2014-02-07
@stability 1 - Experimental

@@ -7,0 +7,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