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

literaljs

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

literaljs - npm Package Compare versions

Comparing version 6.0.1 to 6.0.2

2

build/index.js

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

var e,t,n,i={},r="eid",o=[],f={},u=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],d="string",a="number",c="boolean",s="undefined",v="object",p="function",l="events",y="style",h="value";function m(e){return Array.isArray(e)}function g(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function b(e,t){for(var n in t)e[n]=t[n];return e}function A(e,t,n){return b(b(e,t),n)}function N(){return i}function O(r){var o,f;i=A({},i,r),o=b({},n),f=j(t()),n=f,function e(t,n,i,r){var o=typeof n,f=typeof i,u=t.childNodes[r];if(f===s)x(t,n);else if(o===s)T(i),function(e,t){e.removeChild(t)}(t,u);else if(J(i,n,o))w(t,u,n);else if(J(n,i,f))T(i),w(t,u,n);else if(function(e,t,n,i){return n!==i||(n===d||n===a)&&e!==t||e.e!==t.e||e.id!==t.id}(n,i,o,f))T(i),w(t,u,n);else if(typeof n.e===d){var c;!function(e,t,n){D(t,"up");for(var i,r,o=Object.keys(t.a),f=o.length;f--;)if(r=t.a[o[f]],i=n.a[o[f]],o[f]===y){if(c=typeof(d=i),(a=typeof(u=r))===v&&c===v&&JSON.stringify(u)===JSON.stringify(d)||a===s&&c===s)continue;e.removeAttribute(o[f]),C(r,e)}else o[f]===l?(B(e,n.eid),z(n.eid),t.eid=g(),E(t.eid,r,e)):o[f]===h&&r!==i?e.value=r:typeof i!==s&&r===i||e.setAttribute(o[f],r);var u,d,a,c}(u,n,i);for(var p=i.c.length;p--&&typeof n.c[p]===s;)typeof(c=u.lastChild)===v&&(T(i.c[p]),c.remove());for(var m=0,b=n.c.length;m<b;m++)e(u,n.c[m],i.c[m],m)}}(e,f,o,0)}function j(e){if(typeof e===s)return e;if(typeof e.e===p){var t=b({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===p){var n=new e.init;typeof(e=n.render())===v&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(m(e.c))for(var i=0,r=e.c.length;i<r;i++)e.c[i]=j(e.c[i]);return e}function S(e){var t=typeof e;if(t===d||t===a)return L(e);if(t===c||t===s||typeof e.e===v)return L("");var n=document.createElement(e.e);if(typeof e.a===v)for(var i=Object.keys(e.a),r=i.length;r--;)i[r]===l?(e.eid=g(),E(e.eid,e.a[i[r]],n)):i[r]===y?C(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(D(e,"m"),m(e.c))for(var o=0,f=e.c.length;o<f;o++)x(n,e.c[o]);return n}function k(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+r);return typeof t===d?t:k(e.parentNode)}}function E(t,n,i){i.setAttribute("data-"+r,t),f[t]=n;for(var a=Object.keys(n),c=a.length;c--;)u.includes(a[c])?i.addEventListener(c,f[t][a[c]]):o.includes(a[c])||(o.push(a[c]),e.addEventListener(a[c],function(e){var t=k(e.target);if(typeof t===d&&f[t]){var n=f[t][e.type];typeof n===p&&n(e)}}))}function C(e,t){if(typeof e!==s)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function L(e){return document.createTextNode(e)}function w(e,t,n){e.replaceChild(S(n),t)}function x(e,t){e.appendChild(S(t))}function J(e,t,n){return!1===e&&(typeof t.e===d||n===d||n===a)}function T(e){if(D(e,"un"),typeof e!==s&&(z(e.eid),m(e.c)))for(var t=e.c.length;t--;)T(e.c[t])}function z(e){typeof e===d&&delete f[e]}function B(e,t){for(var n=Object.keys(f[t]),i=n.length;i--;)u.includes(n[i])&&e.removeEventListener(n[i],f[t][n[i]])}function D(e,t){if(typeof e===v&&typeof e[t]===p)return e[t]()}module.exports={component:function(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var i=e.unmounted;void 0===i&&(i=function(){});var r=e.methods;void 0===r&&(r=function(){});var o=e.render;void 0===o&&(o=function(){});var f=g();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=N,this.setState=O,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=i.bind(this),function(e,t){for(var n in typeof t===p&&(t=t.bind(e)()),t)e[n]=t[n].bind(e)}(this,r),this.render=o.bind(this),this}}}},render:function(r,o,f){void 0===f&&(f={}),i=A({},i,f),t=r,e=document.getElementById(o),n=j(r()),x(e,n)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{e:e,a:b({},t),c:function e(t,n){for(var i=0,r=n.length;i<r;i++)m(n[i])?e(t,n[i]):t.push(n[i]);return t}([],n)}}};
var e,t,n,r={},i="eid",o=[],f={},u=[],d=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],a="string",c="number",s="boolean",v="undefined",p="object",l="function",h="events",y="style",m="value";function g(e){return Array.isArray(e)}function b(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function E(e,t){for(var n=0,r=t.length;n<r;n++)g(t[n])?E(e,t[n]):e.push(t[n]);return e}function L(e,t){for(var n in t)e[n]=t[n];return e}function _(e,t,n){return L(L(e,t),n)}function A(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return{e:e,a:L({},t),c:E([],n)}}function C(i,o,f){void 0===f&&(f={}),r=_({},r,f),t=i,e=document.getElementById(o),n=j(i()),J(e,n),D(),window.addEventListener("__LITERAL_LIFECYCLE__",D)}function w(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var r=e.unmounted;void 0===r&&(r=function(){});var i=e.methods;void 0===i&&(i=function(){});var o=e.render;void 0===o&&(o=function(){});var f=b();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=N,this.setState=O,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=r.bind(this),function(e,t){for(var n in typeof t===l&&(t=t.bind(e)()),t)e[n]=t[n].bind(e)}(this,i),this.render=o.bind(this),this}}}}function N(){return r}function O(i){var o,f;r=_({},r,i),o=L({},n),f=j(t()),n=f,function e(t,n,r,i){var o=typeof n,f=typeof r,u=t.childNodes[i];if(f===v)J(t,n);else if(o===v)Y(r),function(e,t){e.removeChild(t)}(t,u);else if(R(r,n,o))F(t,u,n);else if(R(n,r,f))Y(r),F(t,u,n);else if(function(e,t,n,r){return n!==r||(n===a||n===c)&&e!==t||e.e!==t.e||e.id!==t.id}(n,r,o,f))Y(r),F(t,u,n);else if(typeof n.e===a){var d;!function(e,t,n){M(t,"up");for(var r,i,o=Object.keys(t.a),f=o.length;f--;)if(i=t.a[o[f]],r=n.a[o[f]],o[f]===y){if(c=typeof(d=r),(a=typeof(u=i))===p&&c===p&&JSON.stringify(u)===JSON.stringify(d)||a===v&&c===v)continue;e.removeAttribute(o[f]),I(i,e)}else o[f]===h?(B(e,n.eid),z(n.eid),t.eid=b(),x(t.eid,i,e)):o[f]===m&&i!==r?e.value=i:typeof r!==v&&i===r||e.setAttribute(o[f],i);var u,d,a,c}(u,n,r);for(var s=r.c.length;s--&&typeof n.c[s]===v;)typeof(d=u.lastChild)===p&&(Y(r.c[s]),d.remove());for(var l=0,g=n.c.length;l<g;l++)e(u,n.c[l],r.c[l],l)}}(e,f,o,0)}function j(e){if(typeof e===v)return e;if(typeof e.e===l){var t=L({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===l){var n=new e.init;typeof(e=n.render())===p&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(g(e.c))for(var r=0,i=e.c.length;r<i;r++)e.c[r]=j(e.c[r]);return e}function S(e){var t=typeof e;if(t===a||t===c)return T(e);if(t===s||t===v)return T("");var n=document.createElement(e.e);if(typeof e.a===p)for(var r=Object.keys(e.a),i=r.length;i--;)r[i]===h?(e.eid=b(),x(e.eid,e.a[r[i]],n)):r[i]===y?I(e.a[r[i]],n):n.setAttribute(r[i],e.a[r[i]]);if(M(e,"m"),g(e.c))for(var o=0,f=e.c.length;o<f;o++)J(n,e.c[o]);return n}function k(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+i);return typeof t===a?t:k(e.parentNode)}}function x(t,n,r){r.setAttribute("data-"+i,t),f[t]=n;for(var u=Object.keys(n),c=u.length;c--;)d.includes(u[c])?r.addEventListener(c,f[t][u[c]]):o.includes(u[c])||(o.push(u[c]),e.addEventListener(u[c],function(e){var t=k(e.target);if(typeof t===a&&f[t]){var n=f[t][e.type];typeof n===l&&n(e)}}))}function I(e,t){if(typeof e!==v)for(var n=Object.keys(e),r=n.length;r--;)t.style[n[r]]=e[n[r]]}function T(e){return document.createTextNode(e)}function F(e,t,n){e.replaceChild(S(n),t)}function J(e,t){e.appendChild(S(t))}function R(e,t,n){return!1===e&&(typeof t.e===a||n===a||n===c)}function Y(e){if(M(e,"un"),typeof e!==v&&(z(e.eid),g(e.c)))for(var t=e.c.length;t--;)Y(e.c[t])}function z(e){typeof e===a&&delete f[e]}function B(e,t){for(var n=Object.keys(f[t]),r=n.length;r--;)d.includes(n[r])&&e.removeEventListener(n[r],f[t][n[r]])}function D(){for(var e;e=u.shift();)e()}function M(e,t){var n;typeof e===p&&typeof e[t]===l&&(u.push(e[t]),n=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(n))}module.exports={component:w,render:C,h:A},exports.h=A,exports.render=C,exports.component=w;
//# sourceMappingURL=index.js.map

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

var e,t,n,i={},r="eid",o=[],f={},u=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],d="string",a="number",c="boolean",s="undefined",v="object",p="function",l="events",y="style",h="value";function m(e){return Array.isArray(e)}function g(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function b(e,t){for(var n in t)e[n]=t[n];return e}function A(e,t,n){return b(b(e,t),n)}function N(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{e:e,a:b({},t),c:function e(t,n){for(var i=0,r=n.length;i<r;i++)m(n[i])?e(t,n[i]):t.push(n[i]);return t}([],n)}}function O(r,o,f){void 0===f&&(f={}),i=A({},i,f),t=r,e=document.getElementById(o),n=E(r()),z(e,n)}function j(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var i=e.unmounted;void 0===i&&(i=function(){});var r=e.methods;void 0===r&&(r=function(){});var o=e.render;void 0===o&&(o=function(){});var f=g();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=S,this.setState=k,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=i.bind(this),function(e,t){typeof t===p&&(t=t.bind(e)());for(var n in t)e[n]=t[n].bind(e)}(this,r),this.render=o.bind(this),this}}}}function S(){return i}function k(r){var o,f;i=A({},i,r),o=b({},n),f=E(t()),n=f,function e(t,n,i,r){var o=typeof n,f=typeof i,u=t.childNodes[r];if(f===s)z(t,n);else if(o===s)D(i),function(e,t){e.removeChild(t)}(t,u);else if(B(i,n,o))T(t,u,n);else if(B(n,i,f))D(i),T(t,u,n);else if(function(e,t,n,i){return n!==i||(n===d||n===a)&&e!==t||e.e!==t.e||e.id!==t.id}(n,i,o,f))D(i),T(t,u,n);else if(typeof n.e===d){var c;!function(e,t,n){q(t,"up");for(var i,r,o=Object.keys(t.a),f=o.length;f--;)if(r=t.a[o[f]],i=n.a[o[f]],o[f]===y){if(c=typeof(d=i),(a=typeof(u=r))===v&&c===v&&JSON.stringify(u)===JSON.stringify(d)||a===s&&c===s)continue;e.removeAttribute(o[f]),w(r,e)}else o[f]===l?(M(e,n.eid),I(n.eid),t.eid=g(),L(t.eid,r,e)):o[f]===h&&r!==i?e.value=r:typeof i!==s&&r===i||e.setAttribute(o[f],r);var u,d,a,c}(u,n,i);for(var p=i.c.length;p--&&typeof n.c[p]===s;)typeof(c=u.lastChild)===v&&(D(i.c[p]),c.remove());for(var m=0,b=n.c.length;m<b;m++)e(u,n.c[m],i.c[m],m)}}(e,f,o,0)}function E(e){if(typeof e===s)return e;if(typeof e.e===p){var t=b({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===p){var n=new e.init;typeof(e=n.render())===v&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(m(e.c))for(var i=0,r=e.c.length;i<r;i++)e.c[i]=E(e.c[i]);return e}function C(e){var t=typeof e;if(t===d||t===a)return J(e);if(t===c||t===s||typeof e.e===v)return J("");var n=document.createElement(e.e);if(typeof e.a===v)for(var i=Object.keys(e.a),r=i.length;r--;)i[r]===l?(e.eid=g(),L(e.eid,e.a[i[r]],n)):i[r]===y?w(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(q(e,"m"),m(e.c))for(var o=0,f=e.c.length;o<f;o++)z(n,e.c[o]);return n}function x(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+r);return typeof t===d?t:x(e.parentNode)}}function L(t,n,i){i.setAttribute("data-"+r,t),f[t]=n;for(var a=Object.keys(n),c=a.length;c--;)u.includes(a[c])?i.addEventListener(c,f[t][a[c]]):o.includes(a[c])||(o.push(a[c]),e.addEventListener(a[c],function(e){var t=x(e.target);if(typeof t===d&&f[t]){var n=f[t][e.type];typeof n===p&&n(e)}}))}function w(e,t){if(typeof e!==s)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function J(e){return document.createTextNode(e)}function T(e,t,n){e.replaceChild(C(n),t)}function z(e,t){e.appendChild(C(t))}function B(e,t,n){return!1===e&&(typeof t.e===d||n===d||n===a)}function D(e){if(q(e,"un"),typeof e!==s&&(I(e.eid),m(e.c)))for(var t=e.c.length;t--;)D(e.c[t])}function I(e){typeof e===d&&delete f[e]}function M(e,t){for(var n=Object.keys(f[t]),i=n.length;i--;)u.includes(n[i])&&e.removeEventListener(n[i],f[t][n[i]])}function q(e,t){if(typeof e===v&&typeof e[t]===p)return e[t]()}export default{component:j,render:O,h:N};export{N as h,O as render,j as component};
var e,t,n,i={},r="eid",o=[],f={},u=[],d=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],a="string",c="number",s="boolean",v="undefined",p="object",l="function",h="events",y="style",m="value";function g(e){return Array.isArray(e)}function b(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function E(e,t){for(var n=0,i=t.length;n<i;n++)g(t[n])?E(e,t[n]):e.push(t[n]);return e}function L(e,t){for(var n in t)e[n]=t[n];return e}function _(e,t,n){return L(L(e,t),n)}function A(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{e:e,a:L({},t),c:E([],n)}}function C(r,o,f){void 0===f&&(f={}),i=_({},i,f),t=r,e=document.getElementById(o),n=j(r()),J(e,n),D(),window.addEventListener("__LITERAL_LIFECYCLE__",D)}function w(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var i=e.unmounted;void 0===i&&(i=function(){});var r=e.methods;void 0===r&&(r=function(){});var o=e.render;void 0===o&&(o=function(){});var f=b();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=N,this.setState=O,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=i.bind(this),function(e,t){for(var n in typeof t===l&&(t=t.bind(e)()),t)e[n]=t[n].bind(e)}(this,r),this.render=o.bind(this),this}}}}function N(){return i}function O(r){var o,f;i=_({},i,r),o=L({},n),f=j(t()),n=f,function e(t,n,i,r){var o=typeof n,f=typeof i,u=t.childNodes[r];if(f===v)J(t,n);else if(o===v)Y(i),function(e,t){e.removeChild(t)}(t,u);else if(R(i,n,o))F(t,u,n);else if(R(n,i,f))Y(i),F(t,u,n);else if(function(e,t,n,i){return n!==i||(n===a||n===c)&&e!==t||e.e!==t.e||e.id!==t.id}(n,i,o,f))Y(i),F(t,u,n);else if(typeof n.e===a){var d;!function(e,t,n){M(t,"up");for(var i,r,o=Object.keys(t.a),f=o.length;f--;)if(r=t.a[o[f]],i=n.a[o[f]],o[f]===y){if(c=typeof(d=i),(a=typeof(u=r))===p&&c===p&&JSON.stringify(u)===JSON.stringify(d)||a===v&&c===v)continue;e.removeAttribute(o[f]),T(r,e)}else o[f]===h?(B(e,n.eid),z(n.eid),t.eid=b(),I(t.eid,r,e)):o[f]===m&&r!==i?e.value=r:typeof i!==v&&r===i||e.setAttribute(o[f],r);var u,d,a,c}(u,n,i);for(var s=i.c.length;s--&&typeof n.c[s]===v;)typeof(d=u.lastChild)===p&&(Y(i.c[s]),d.remove());for(var l=0,g=n.c.length;l<g;l++)e(u,n.c[l],i.c[l],l)}}(e,f,o,0)}function j(e){if(typeof e===v)return e;if(typeof e.e===l){var t=L({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===l){var n=new e.init;typeof(e=n.render())===p&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(g(e.c))for(var i=0,r=e.c.length;i<r;i++)e.c[i]=j(e.c[i]);return e}function S(e){var t=typeof e;if(t===a||t===c)return x(e);if(t===s||t===v)return x("");var n=document.createElement(e.e);if(typeof e.a===p)for(var i=Object.keys(e.a),r=i.length;r--;)i[r]===h?(e.eid=b(),I(e.eid,e.a[i[r]],n)):i[r]===y?T(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(M(e,"m"),g(e.c))for(var o=0,f=e.c.length;o<f;o++)J(n,e.c[o]);return n}function k(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+r);return typeof t===a?t:k(e.parentNode)}}function I(t,n,i){i.setAttribute("data-"+r,t),f[t]=n;for(var u=Object.keys(n),c=u.length;c--;)d.includes(u[c])?i.addEventListener(c,f[t][u[c]]):o.includes(u[c])||(o.push(u[c]),e.addEventListener(u[c],function(e){var t=k(e.target);if(typeof t===a&&f[t]){var n=f[t][e.type];typeof n===l&&n(e)}}))}function T(e,t){if(typeof e!==v)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function x(e){return document.createTextNode(e)}function F(e,t,n){e.replaceChild(S(n),t)}function J(e,t){e.appendChild(S(t))}function R(e,t,n){return!1===e&&(typeof t.e===a||n===a||n===c)}function Y(e){if(M(e,"un"),typeof e!==v&&(z(e.eid),g(e.c)))for(var t=e.c.length;t--;)Y(e.c[t])}function z(e){typeof e===a&&delete f[e]}function B(e,t){for(var n=Object.keys(f[t]),i=n.length;i--;)d.includes(n[i])&&e.removeEventListener(n[i],f[t][n[i]])}function D(){for(var e;e=u.shift();)e()}function M(e,t){var n;typeof e===p&&typeof e[t]===l&&(u.push(e[t]),n=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(n))}module.exports={component:w,render:C,h:A};export{A as h,C as render,w as component};
//# sourceMappingURL=index.m.js.map

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.literaljs=t()}(this,function(){var e,t,n,i={},r="eid",o=[],f={},u=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],d="string",c="number",a="boolean",s="undefined",v="object",p="function",l="events",y="style",h="value";function m(e){return Array.isArray(e)}function b(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function g(e,t){for(var n in t)e[n]=t[n];return e}function j(e,t,n){return g(g(e,t),n)}function A(){return i}function N(r){var o,f;i=j({},i,r),o=g({},n),f=O(t()),n=f,function e(t,n,i,r){var o=typeof n,f=typeof i,u=t.childNodes[r];if(f===s)w(t,n);else if(o===s)T(i),function(e,t){e.removeChild(t)}(t,u);else if(J(i,n,o))L(t,u,n);else if(J(n,i,f))T(i),L(t,u,n);else if(function(e,t,n,i){return n!==i||(n===d||n===c)&&e!==t||e.e!==t.e||e.id!==t.id}(n,i,o,f))T(i),L(t,u,n);else if(typeof n.e===d){var a;!function(e,t,n){D(t,"up");for(var i,r,o=Object.keys(t.a),f=o.length;f--;)if(r=t.a[o[f]],i=n.a[o[f]],o[f]===y){if(a=typeof(d=i),(c=typeof(u=r))===v&&a===v&&JSON.stringify(u)===JSON.stringify(d)||c===s&&a===s)continue;e.removeAttribute(o[f]),C(r,e)}else o[f]===l?(B(e,n.eid),z(n.eid),t.eid=b(),E(t.eid,r,e)):o[f]===h&&r!==i?e.value=r:typeof i!==s&&r===i||e.setAttribute(o[f],r);var u,d,c,a}(u,n,i);for(var p=i.c.length;p--&&typeof n.c[p]===s;)typeof(a=u.lastChild)===v&&(T(i.c[p]),a.remove());for(var m=0,g=n.c.length;m<g;m++)e(u,n.c[m],i.c[m],m)}}(e,f,o,0)}function O(e){if(typeof e===s)return e;if(typeof e.e===p){var t=g({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===p){var n=new e.init;typeof(e=n.render())===v&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(m(e.c))for(var i=0,r=e.c.length;i<r;i++)e.c[i]=O(e.c[i]);return e}function S(e){var t=typeof e;if(t===d||t===c)return x(e);if(t===a||t===s||typeof e.e===v)return x("");var n=document.createElement(e.e);if(typeof e.a===v)for(var i=Object.keys(e.a),r=i.length;r--;)i[r]===l?(e.eid=b(),E(e.eid,e.a[i[r]],n)):i[r]===y?C(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(D(e,"m"),m(e.c))for(var o=0,f=e.c.length;o<f;o++)w(n,e.c[o]);return n}function k(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+r);return typeof t===d?t:k(e.parentNode)}}function E(t,n,i){i.setAttribute("data-"+r,t),f[t]=n;for(var c=Object.keys(n),a=c.length;a--;)u.includes(c[a])?i.addEventListener(a,f[t][c[a]]):o.includes(c[a])||(o.push(c[a]),e.addEventListener(c[a],function(e){var t=k(e.target);if(typeof t===d&&f[t]){var n=f[t][e.type];typeof n===p&&n(e)}}))}function C(e,t){if(typeof e!==s)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function x(e){return document.createTextNode(e)}function L(e,t,n){e.replaceChild(S(n),t)}function w(e,t){e.appendChild(S(t))}function J(e,t,n){return!1===e&&(typeof t.e===d||n===d||n===c)}function T(e){if(D(e,"un"),typeof e!==s&&(z(e.eid),m(e.c)))for(var t=e.c.length;t--;)T(e.c[t])}function z(e){typeof e===d&&delete f[e]}function B(e,t){for(var n=Object.keys(f[t]),i=n.length;i--;)u.includes(n[i])&&e.removeEventListener(n[i],f[t][n[i]])}function D(e,t){if(typeof e===v&&typeof e[t]===p)return e[t]()}return{component:function(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var i=e.unmounted;void 0===i&&(i=function(){});var r=e.methods;void 0===r&&(r=function(){});var o=e.render;void 0===o&&(o=function(){});var f=b();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=A,this.setState=N,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=i.bind(this),function(e,t){for(var n in typeof t===p&&(t=t.bind(e)()),t)e[n]=t[n].bind(e)}(this,r),this.render=o.bind(this),this}}}},render:function(r,o,f){void 0===f&&(f={}),i=j({},i,f),t=r,e=document.getElementById(o),n=O(r()),w(e,n)},h:function(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{e:e,a:g({},t),c:function e(t,n){for(var i=0,r=n.length;i<r;i++)m(n[i])?e(t,n[i]):t.push(n[i]);return t}([],n)}}}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.literaljs={})}(this,function(e){var t,n,i,r={},o="eid",f=[],u={},d=[],c=["abort","blur","error","focus","load","mouseenter","mouseleave","resize","scroll","unload"],a="string",s="number",v="boolean",p="undefined",l="object",h="function",y="events",m="style",b="value";function g(e){return Array.isArray(e)}function E(){return Math.random().toString(36).substring(2)+(new Date).getTime().toString(36)}function L(e,t){for(var n=0,i=t.length;n<i;n++)g(t[n])?L(e,t[n]):e.push(t[n]);return e}function _(e,t){for(var n in t)e[n]=t[n];return e}function A(e,t,n){return _(_(e,t),n)}function j(e,t){for(var n=[],i=arguments.length-2;i-- >0;)n[i]=arguments[i+2];return{e:e,a:_({},t),c:L([],n)}}function C(e,o,f){void 0===f&&(f={}),r=A({},r,f),n=e,t=document.getElementById(o),i=S(e()),R(t,i),M(),window.addEventListener("__LITERAL_LIFECYCLE__",M)}function w(e){void 0===e&&(e={});var t=e.mounted;void 0===t&&(t=function(){});var n=e.updated;void 0===n&&(n=function(){});var i=e.unmounted;void 0===i&&(i=function(){});var r=e.methods;void 0===r&&(r=function(){});var o=e.render;void 0===o&&(o=function(){});var f=E();return function(e){return void 0===e&&(e={}),{id:f,init:function(){return this.id=f,this.props=e,this.getState=N,this.setState=O,this.mounted=t.bind(this),this.updated=n.bind(this),this.unmounted=i.bind(this),function(e,t){for(var n in typeof t===h&&(t=t.bind(e)()),t)e[n]=t[n].bind(e)}(this,r),this.render=o.bind(this),this}}}}function N(){return r}function O(e){var o,f;r=A({},r,e),o=_({},i),f=S(n()),i=f,function e(t,n,i,r){var o=typeof n,f=typeof i,u=t.childNodes[r];if(f===p)R(t,n);else if(o===p)z(i),function(e,t){e.removeChild(t)}(t,u);else if(Y(i,n,o))J(t,u,n);else if(Y(n,i,f))z(i),J(t,u,n);else if(function(e,t,n,i){return n!==i||(n===a||n===s)&&e!==t||e.e!==t.e||e.id!==t.id}(n,i,o,f))z(i),J(t,u,n);else if(typeof n.e===a){var d;!function(e,t,n){q(t,"up");for(var i,r,o=Object.keys(t.a),f=o.length;f--;)if(r=t.a[o[f]],i=n.a[o[f]],o[f]===m){if(a=typeof(d=i),(c=typeof(u=r))===l&&a===l&&JSON.stringify(u)===JSON.stringify(d)||c===p&&a===p)continue;e.removeAttribute(o[f]),T(r,e)}else o[f]===y?(D(e,n.eid),B(n.eid),t.eid=E(),I(t.eid,r,e)):o[f]===b&&r!==i?e.value=r:typeof i!==p&&r===i||e.setAttribute(o[f],r);var u,d,c,a}(u,n,i);for(var c=i.c.length;c--&&typeof n.c[c]===p;)typeof(d=u.lastChild)===l&&(z(i.c[c]),d.remove());for(var v=0,h=n.c.length;v<h;v++)e(u,n.c[v],i.c[v],v)}}(t,f,o,0)}function S(e){if(typeof e===p)return e;if(typeof e.e===h){var t=_({},e.a.props);delete e.a.props,e=e.e(t)}if(typeof e.init===h){var n=new e.init;typeof(e=n.render())===l&&(e.id=n.id,e.m=n.mounted,e.up=n.updated,e.un=n.unmounted)}if(g(e.c))for(var i=0,r=e.c.length;i<r;i++)e.c[i]=S(e.c[i]);return e}function k(e){var t=typeof e;if(t===a||t===s)return F(e);if(t===v||t===p)return F("");var n=document.createElement(e.e);if(typeof e.a===l)for(var i=Object.keys(e.a),r=i.length;r--;)i[r]===y?(e.eid=E(),I(e.eid,e.a[i[r]],n)):i[r]===m?T(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(q(e,"m"),g(e.c))for(var o=0,f=e.c.length;o<f;o++)R(n,e.c[o]);return n}function x(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+o);return typeof t===a?t:x(e.parentNode)}}function I(e,n,i){i.setAttribute("data-"+o,e),u[e]=n;for(var r=Object.keys(n),d=r.length;d--;)c.includes(r[d])?i.addEventListener(d,u[e][r[d]]):f.includes(r[d])||(f.push(r[d]),t.addEventListener(r[d],function(e){var t=x(e.target);if(typeof t===a&&u[t]){var n=u[t][e.type];typeof n===h&&n(e)}}))}function T(e,t){if(typeof e!==p)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function F(e){return document.createTextNode(e)}function J(e,t,n){e.replaceChild(k(n),t)}function R(e,t){e.appendChild(k(t))}function Y(e,t,n){return!1===e&&(typeof t.e===a||n===a||n===s)}function z(e){if(q(e,"un"),typeof e!==p&&(B(e.eid),g(e.c)))for(var t=e.c.length;t--;)z(e.c[t])}function B(e){typeof e===a&&delete u[e]}function D(e,t){for(var n=Object.keys(u[t]),i=n.length;i--;)c.includes(n[i])&&e.removeEventListener(n[i],u[t][n[i]])}function M(){for(var e;e=d.shift();)e()}function q(e,t){var n;typeof e===l&&typeof e[t]===h&&(d.push(e[t]),n=new Event("__LITERAL_LIFECYCLE__"),window.dispatchEvent(n))}module.exports={component:w,render:C,h:j},e.h=j,e.render=C,e.component=w});
//# sourceMappingURL=index.umd.js.map
{
"name": "literaljs",
"version": "6.0.1",
"version": "6.0.2",
"description": "A small JavaScript library for building reactive user interfaces.",

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

@@ -7,3 +7,3 @@ <p align="center">

# LiteralJS
### A small JavaScript library for building reactive user interfaces.
### A small JavaScript library for building user interfaces.

@@ -13,9 +13,11 @@ ### Links

Recent 6.0.1 microbundle:
Recent 6.0.2 microbundle:
```js
$ microbundle
Build output to build:
1.72 kB: index.js
1.74 kB: index.m.js
1.77 kB: index.umd.js
Build "literaljs" to build:
1821 B: index.js.gz
1587 B: index.js.br
1824 B: index.m.js.gz
1590 B: index.m.js.br
1889 B: index.umd.js.gz
1638 B: index.umd.js.br
```

@@ -26,3 +28,3 @@ ### [Features and stuff](#features)

- **Startup**: Amazing startup metrics; Great for weaker devices and weaker connections.
- **Simple**: LiteralJS uses regular functions and applies structure to building components for easier development.
- **Simple**: LiteralJS uses plain functions and applies structure to building components for easier development.
- **Fast**: Current and previous vDOM data is diffed instead of the actual DOM for performant updates and rendering.

@@ -29,0 +31,0 @@ - **Virtual DOM**: Diffing occurs only on state update for more efficient DOM updates.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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