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.4 to 6.0.5

2

build/index.js

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

var e,t,n,i={},r="eid",o=[],u={},f=[],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 C(e,t,n){return L(L(e,t),n)}function _(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 A(r,o,u){void 0===u&&(u={}),i=C({},i,u),t=r,e=document.getElementById(o),n=S(r()),F(e,n),z(),window.addEventListener("__LITERAL_LIFECYCLE__",z)}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 u=b();return function(e){return void 0===e&&(e={}),{id:u,init:function(){return this.id=u,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,u;i=C({},i,r),o=L({},n),u=S(t()),n=u,function e(t,n,i,r){var o=typeof i,u=typeof r;if(u===v)F(t,i);else if(o===v)J(r),function(e,t){e.removeChild(t)}(t,n);else if(function(e,t,n,i){return n!==i||e.e!==t.e||e.id!==t.id||(n===a||n===c)&&e!==t}(i,r,o,u))J(r),function(e,t,n){e.replaceChild(j(n),t),B(n,"m")}(t,n,i);else if(typeof i.e===a){if(null===n)return;var f;!function(e,t,n){B(t,"up");for(var i,r,o=Object.keys(t.a),u=o.length;u--;)if(r=t.a[o[u]],i=n.a[o[u]],o[u]===y){if(c=typeof(d=i),(a=typeof(f=r))===p&&c===p&&JSON.stringify(f)===JSON.stringify(d)||a===v&&c===v)continue;e.removeAttribute(o[u]),I(r,e)}else o[u]===h?(Y(e,n.eid),R(n.eid),t.eid=b(),k(t.eid,r,e)):o[u]===m&&r!==i?e.value=r:typeof i!==v&&r===i||e.setAttribute(o[u],r);var f,d,a,c}(n,i,r);for(var d=r.c.length;d--&&typeof i.c[d]===v;)typeof(f=n.lastChild)===p&&(J(r.c[d]),f.remove());for(var s=n.firstChild,l=0,g=i.c.length;l<g;l++)e(n,s,i.c[l],r.c[l]),s=null===s?n.childNodes[l]:s.nextSibling}}(e,e.firstChild,u,o),window.dispatchEvent(new Event("__LITERAL_LIFECYCLE__"))}function S(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]=S(e.c[i]);return e}function j(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 i=Object.keys(e.a),r=i.length;r--;)i[r]===h?(e.eid=b(),k(e.eid,e.a[i[r]],n)):i[r]===y?I(e.a[i[r]],n):n.setAttribute(i[r],e.a[i[r]]);if(g(e.c))for(var o=0,u=e.c.length;o<u;o++)F(n,e.c[o]);return n}function x(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+r);return typeof t===a?t:x(e.parentNode)}}function k(t,n,i){i.setAttribute("data-"+r,t),u[t]=n;for(var f=Object.keys(n),c=f.length;c--;)d.includes(f[c])?i.addEventListener(f[c],u[t][f[c]]):o.includes(f[c])||(o.push(f[c]),e.addEventListener(f[c],function(e){var t=x(e.target);if(typeof t===a&&u[t]){var n=u[t][e.type];typeof n===l&&n(e)}}))}function I(e,t){if(typeof e!==v)for(var n=Object.keys(e),i=n.length;i--;)t.style[n[i]]=e[n[i]]}function T(e){return document.createTextNode(e)}function F(e,t){e.appendChild(j(t)),B(t,"m")}function J(e){if(typeof e!==v&&(B(e,"un"),R(e.eid),g(e.c)))for(var t=e.c.length;t--;)J(e.c[t])}function R(e){typeof e===a&&delete u[e]}function Y(e,t){for(var n=Object.keys(u[t]),i=n.length;i--;)d.includes(n[i])&&e.removeEventListener(n[i],u[t][n[i]])}function z(){for(var e;e=f.pop();)e()}function B(e,t){typeof e===p&&typeof e[t]===l&&f.push(e[t])}module.exports={component:w,render:A,h:_},exports.h=_,exports.render=A,exports.component=w;
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 N(e,t){for(var n=0,r=t.length;n<r;n++)g(t[n])?N(e,t[n]):e.push(t[n]);return e}function A(e,t){for(var n in t)e[n]=t[n];return e}function O(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return{e:e,a:A({},t),c:N([],n)}}function j(i,o,f){void 0===f&&(f={}),r=A({},f),t=i,e=document.getElementById(o),n=C(i()),J(e,n),I()}function x(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=S,this.setState=k,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 S(){return r}function k(i){var o,f,u;o=i,r=A(A({},r),o),f=A({},n),u=C(t()),n=u,function e(t,n,r,i){var o=typeof r,f=typeof i;if(f===v)J(t,r);else if(o===v)z(i),t.removeChild(n);else if(function(e,t,n,r){return n!==r||e.e!==t.e||e.id!==t.id||(n===a||n===c)&&e!==t}(r,i,o,f))z(i),t.replaceChild(E(r),n);else if(o===p){var u;!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]),w(i,e)}else o[f]===h?(D(e,n.eid),B(n.eid),t.eid=b(),T(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}(n,r,i);for(var d=i.c.length;d--&&typeof r.c[d]===v;)typeof(u=n.lastChild)===p&&(z(i.c[d]),u.remove());for(var s=0,l=r.c.length;s<l;s++)e(n,n.childNodes[s],r.c[s],i.c[s])}}(e,e.firstChild,u,f),I()}function C(e){if(typeof e===v)return e;if(typeof e.e===l){var t=A({},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]=C(e.c[r]);return e}function E(e){var t=typeof e;if(t===a||t===c)return document.createTextNode(e);if(t===s||t===v)return document.createTextNode("");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(),T(e.eid,e.a[r[i]],n)):r[i]===y?w(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 L(e){if("#document"!==e.parentNode.nodeName){var t=e.getAttribute("data-"+i);return typeof t===a?t:L(e.parentNode)}}function T(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(u[c],f[t][u[c]]):o.includes(u[c])||(o.push(u[c]),e.addEventListener(u[c],function(e){var t=L(e.target);if(typeof t===a&&f[t]){var n=f[t][e.type];typeof n===l&&n(e)}}))}function w(e,t){if(typeof e!==v)for(var n=Object.keys(e),r=n.length;r--;)t.style[n[r]]=e[n[r]]}function J(e,t){e.appendChild(E(t))}function z(e){if(typeof e!==v&&(M(e,"un"),B(e.eid),g(e.c)))for(var t=e.c.length;t--;)z(e.c[t])}function B(e){typeof e===a&&delete f[e]}function D(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 I(){for(var e;e=u.shift();)e()}function M(e,t){typeof e===p&&typeof e[t]===l&&u.push(e[t])}module.exports={component:x,render:j,h:O},exports.h=O,exports.render=j,exports.component=x;
//# sourceMappingURL=index.js.map

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

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

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

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

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

@@ -12,11 +12,11 @@ <p align="center">

Recent 6.0.4 microbundle:
Recent 6.0.5 microbundle:
```js
Build "literaljs" to build:
1809 B: index.js.gz
1570 B: index.js.br
1811 B: index.m.js.gz
1575 B: index.m.js.br
1873 B: index.umd.js.gz
1625 B: index.umd.js.br
Build "literaljs" to build:
1698 B: index.js.gz
1465 B: index.js.br
1701 B: index.m.js.gz
1466 B: index.m.js.br
1762 B: index.umd.js.gz
1521 B: index.umd.js.br
```

@@ -23,0 +23,0 @@ ### [Features and stuff](#features)

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