New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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 2.4.2 to 2.4.3

2

build/index.js

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

var e={},t=[],n=[];module.exports={component:function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}},render:function(r,i,o){void 0===o&&(o={});var d=document.getElementById(i);function u(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function a(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=a(e.children[n],t);return e}function c(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,a=Object.entries(e);u<a.length;u+=1){var f=a[u],l=f[0],s=f[1];if("text"===l&&d.appendChild(document.createTextNode(s)),"events"===l&&p(s,d,r,i),["children","element","text","events"].includes(l)||d.setAttribute(l,s),"children"===l)for(var h=0;h<s.length;h++)d.appendChild(c(s[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],a=u[0],c=u[1];["mounted","unmounted","updated"].includes(a)||t.addEventListener(a,c),f(a,c,r,i)}function f(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),v())}}}function v(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}e=Object.assign({},e,o),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop();return function e(t,r,i,o){if(void 0===o&&(o=0),t){var d=t.childNodes[o];if(!i&&r)!1===i?(t.insertBefore(c(r),d),p(r,"mounted")):void 0===i?(t.appendChild(c(r)),p(r,"mounted")):0===i&&h(t,d,r);else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n){for(var r=0,i=Object.entries(n);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];t[d]||(e.removeAttribute(u),p(t,"updated"))}}(d,r,i),function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],a=d[1],c=r[u];"element"===u||"text"===u?a!==c&&h(e,t,n):["children","events","element","text"].includes(u)||c&&a===c||(t.setAttribute(u,a),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<s(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),a=u.nChildren,f=u.oChildren,l=0;l<s(a,f);l++)e(d,a[l],f[l],l)}function s(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(c(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}v()}}}(d,a(r(),e.newState),a(r(),e.oldState))})}),d.appendChild(c(a(r(),e),{initial:!0})),u(),window.addEventListener("__LITERAL_LIFECYCLE__",u)},h:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})}};
var e={},t=[],n=[],r={};module.exports={component:function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}},render:function(i,o,d){void 0===d&&(d={});var u=document.getElementById(o);e=Object.assign({},e,d),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop(),o=s(i(),e.newState),d=Object.assign({},r);return r=Object.assign({},o),function e(t,r,i,o){if(void 0===o&&(o=0),t){var d=t.childNodes[o];if(!1===i)t.insertBefore(v(r),d),p(r,"mounted");else if(void 0===i)t.appendChild(v(r)),p(r,"mounted");else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],a=d[1],c=r[u];"element"===u||"text"===u?a!==c&&h(e,t,n):["children","events","element","text"].includes(u)||c&&a===c||(t.setAttribute(u,a),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<l(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),a=u.nChildren,c=u.oChildren,s=0;s<l(a,c);s++)e(d,a[s],c[s],s)}function l(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(v(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}f()}}}(u,o,d)})});var a=s(i(),e);function c(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function s(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=s(e.children[n],t);return e}function v(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,a=Object.entries(e);u<a.length;u+=1){var c=a[u],s=c[0],l=c[1];if("text"===s&&d.appendChild(document.createTextNode(l)),"events"===s&&p(l,d,r,i),["children","element","text","events"].includes(s)||d.setAttribute(s,l),"children"===s)for(var h=0;h<l.length;h++)d.appendChild(v(l[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],a=u[0],c=u[1];["mounted","unmounted","updated"].includes(a)||t.addEventListener(a,c),s(a,c,r,i)}function s(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),f())}}}function f(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}r=Object.assign({},a),u.appendChild(v(a,{initial:!0})),c(),window.addEventListener("__LITERAL_LIFECYCLE__",c)},h:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})}};
//# sourceMappingURL=index.js.map

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

var e={},t=[],n=[],r=function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})},i=function(r,i,o){void 0===o&&(o={});var d=document.getElementById(i);function u(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function a(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=a(e.children[n],t);return e}function c(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,a=Object.entries(e);u<a.length;u+=1){var f=a[u],l=f[0],s=f[1];if("text"===l&&d.appendChild(document.createTextNode(s)),"events"===l&&p(s,d,r,i),["children","element","text","events"].includes(l)||d.setAttribute(l,s),"children"===l)for(var h=0;h<s.length;h++)d.appendChild(c(s[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],a=u[0],c=u[1];["mounted","unmounted","updated"].includes(a)||t.addEventListener(a,c),f(a,c,r,i)}function f(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),v())}}}function v(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}e=Object.assign({},e,o),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop();return function e(t,r,i,o){void 0===o&&(o=0);if(!t)return;var d=t.childNodes[o];if(!i&&r)!1===i?(t.insertBefore(c(r),d),p(r,"mounted")):void 0===i?(t.appendChild(c(r)),p(r,"mounted")):0===i&&h(t,d,r);else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n){for(var r=0,i=Object.entries(n);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];t[d]||(e.removeAttribute(u),p(t,"updated"))}}(d,r,i),function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],a=d[1],c=r[u];"element"===u||"text"===u?a!==c&&h(e,t,n):["children","events","element","text"].includes(u)||c&&a===c||(t.setAttribute(u,a),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<s(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),a=u.nChildren,f=u.oChildren,l=0;l<s(a,f);l++)e(d,a[l],f[l],l);function s(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(c(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}v()}}}(d,a(r(),e.newState),a(r(),e.oldState))})}),d.appendChild(c(a(r(),e),{initial:!0})),u(),window.addEventListener("__LITERAL_LIFECYCLE__",u)},o=function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}};export default{component:o,render:i,h:r};export{r as h,i as render,o as component};
var e={},t=[],n=[],r={},i=function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})},o=function(i,o,d){void 0===d&&(d={});var u=document.getElementById(o);e=Object.assign({},e,d),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop(),o=f(i(),e.newState),d=Object.assign({},r);return r=Object.assign({},o),function e(t,r,i,o){void 0===o&&(o=0);if(!t)return;var d=t.childNodes[o];if(!1===i)t.insertBefore(s(r),d),p(r,"mounted");else if(void 0===i)t.appendChild(s(r)),p(r,"mounted");else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],a=d[1],c=r[u];"element"===u||"text"===u?a!==c&&h(e,t,n):["children","events","element","text"].includes(u)||c&&a===c||(t.setAttribute(u,a),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<l(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),a=u.nChildren,c=u.oChildren,f=0;f<l(a,c);f++)e(d,a[f],c[f],f);function l(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(s(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}v()}}}(u,o,d)})});var a=f(i(),e);function c(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function f(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=f(e.children[n],t);return e}function s(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,a=Object.entries(e);u<a.length;u+=1){var c=a[u],f=c[0],l=c[1];if("text"===f&&d.appendChild(document.createTextNode(l)),"events"===f&&p(l,d,r,i),["children","element","text","events"].includes(f)||d.setAttribute(f,l),"children"===f)for(var h=0;h<l.length;h++)d.appendChild(s(l[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],a=u[0],c=u[1];["mounted","unmounted","updated"].includes(a)||t.addEventListener(a,c),f(a,c,r,i)}function f(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),v())}}}function v(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}r=Object.assign({},a),u.appendChild(s(a,{initial:!0})),c(),window.addEventListener("__LITERAL_LIFECYCLE__",c)},d=function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}};export default{component:d,render:o,h:i};export{i as h,o as render,d 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=[];return{component:function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}},render:function(r,i,o){void 0===o&&(o={});var d=document.getElementById(i);function u(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function c(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=c(e.children[n],t);return e}function a(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,c=Object.entries(e);u<c.length;u+=1){var l=c[u],v=l[0],s=l[1];if("text"===v&&d.appendChild(document.createTextNode(s)),"events"===v&&p(s,d,r,i),["children","element","text","events"].includes(v)||d.setAttribute(v,s),"children"===v)for(var h=0;h<s.length;h++)d.appendChild(a(s[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],c=u[0],a=u[1];["mounted","unmounted","updated"].includes(c)||t.addEventListener(c,a),l(c,a,r,i)}function l(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),f())}}}function f(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}e=Object.assign({},e,o),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop();return function e(t,r,i,o){if(void 0===o&&(o=0),t){var d=t.childNodes[o];if(!i&&r)!1===i?(t.insertBefore(a(r),d),p(r,"mounted")):void 0===i?(t.appendChild(a(r)),p(r,"mounted")):0===i&&h(t,d,r);else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n){for(var r=0,i=Object.entries(n);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];t[d]||(e.removeAttribute(u),p(t,"updated"))}}(d,r,i),function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],c=d[1],a=r[u];"element"===u||"text"===u?c!==a&&h(e,t,n):["children","events","element","text"].includes(u)||a&&c===a||(t.setAttribute(u,c),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<s(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),c=u.nChildren,l=u.oChildren,v=0;v<s(c,l);v++)e(d,c[v],l[v],v)}function s(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(a(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}f()}}}(d,c(r(),e.newState),c(r(),e.oldState))})}),d.appendChild(a(c(r(),e),{initial:!0})),u(),window.addEventListener("__LITERAL_LIFECYCLE__",u)},h:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})}}});
!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=[],r={};return{component:function(n){void 0===n&&(n={});var r=n.methods;void 0===r&&(r=function(){});var i=n.render;return void 0===i&&(i=function(){}),function(n){return void 0===n&&(n={}),function(o){var d=function(t){return void 0===t&&(t=e),Object.assign({},t)},u=function(n){var r=d(),i={oldState:r,nextState:Object.assign({},r,n)};e=i.nextState,t.push(i);var o=new Event("__LITERAL_UPDATE__");return window.dispatchEvent(o)};return i({state:d(o),getState:d,setState:u,props:n,methods:r({getState:d,setState:u})})}}},render:function(i,o,d){void 0===d&&(d={});var u=document.getElementById(o);e=Object.assign({},e,d),window.addEventListener("__LITERAL_UPDATE__",function(){return setTimeout(function(){var e=t.pop(),o=f(i(),e.newState),d=Object.assign({},r);return r=Object.assign({},o),function e(t,r,i,o){if(void 0===o&&(o=0),t){var d=t.childNodes[o];if(!1===i)t.insertBefore(s(r),d),p(r,"mounted");else if(void 0===i)t.appendChild(s(r)),p(r,"mounted");else if(!r&&i)t.removeChild(d),p(i,"unmounted");else if(r&&(function(e,t,n,r){"object"==typeof n&&"object"==typeof r||n!==r&&h(e,t,n);for(var i=0,o=Object.entries(n);i<o.length;i+=1){var d=o[i],u=d[0],c=d[1],a=r[u];"element"===u||"text"===u?c!==a&&h(e,t,n):["children","events","element","text"].includes(u)||a&&c===a||(t.setAttribute(u,c),p(n,"updated"))}}(t,d,r,i),r.children||i.children))for(var u=function(e,t){for(var n=[],r=[],i=0;i<v(e,t);i++)!1===e[i]&&!1===t[i]||(n.push(e[i]),r.push(t[i]));return{nChildren:n,oChildren:r}}(r.children,i.children),c=u.nChildren,a=u.oChildren,f=0;f<v(c,a);f++)e(d,c[f],a[f],f)}function v(e,t){var n=e.length||0,r=t.length||0;return n>=r?n:r}function h(e,t,n){e.replaceChild(s(n,{mount:!1}),t),p(n,"mounted")}function p(e,t){if(e.events){for(var r=0,i=Object.entries(e.events);r<i.length;r+=1){var o=i[r],d=o[0],u=o[1];d===t&&n.push(u)}l()}}}(u,o,d)})});var c=f(i(),e);function a(){var e;return setTimeout(function(){for(;e=n.pop();)e()})}function f(e,t){if((e="function"==typeof e?e(t):e).children)for(var n=0;n<e.children.length;n++)e.children[n]=f(e.children[n],t);return e}function s(e,t){void 0===t&&(t={});var r=t.mount;void 0===r&&(r=!0);var i=t.initial;void 0===i&&(i=!1);var o=typeof e;if("object"!==o&&"boolean"!==o)return document.createTextNode(e);for(var d=document.createElement(e.element),u=0,c=Object.entries(e);u<c.length;u+=1){var a=c[u],f=a[0],v=a[1];if("text"===f&&d.appendChild(document.createTextNode(v)),"events"===f&&p(v,d,r,i),["children","element","text","events"].includes(f)||d.setAttribute(f,v),"children"===f)for(var h=0;h<v.length;h++)d.appendChild(s(v[h],{mount:r,initial:i}))}return d;function p(e,t,r,i){for(var o=0,d=Object.entries(e);o<d.length;o+=1){var u=d[o],c=u[0],a=u[1];["mounted","unmounted","updated"].includes(c)||t.addEventListener(c,a),f(c,a,r,i)}function f(e,t,r,i){i&&(r&&"mounted"===e&&n.push(t),r||"updated"!==e||n.push(t),l())}}}function l(){var e=new Event("__LITERAL_LIFECYCLE__");return window.dispatchEvent(e)}r=Object.assign({},c),u.appendChild(s(c,{initial:!0})),a(),window.addEventListener("__LITERAL_LIFECYCLE__",a)},h:function(e,t){for(var n=[],r=arguments.length-2;r-- >0;)n[r]=arguments[r+2];return"function"==typeof e?e:Object.assign({},{element:e},t,{children:function e(t,n){for(var r=0;r<t.length;r++)Array.isArray(t[r])?e(t[r],n):n.push(t[r]);return n}(n,[])})}}});
//# sourceMappingURL=index.umd.js.map
{
"name": "literaljs",
"version": "2.4.2",
"version": "2.4.3",
"description": "~1kb JavaScript library for building user interfaces.",

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

@@ -15,5 +15,5 @@ <p align="center">

Build output to build:
1.42 kB: index.js
1.44 kB: index.m.js
1.47 kB: index.umd.js
1.39 kB: index.js
1.43 kB: index.m.js
1.44 kB: index.umd.js
```

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