From 31cb627962d77191f47bda78eca84273beedbf96 Mon Sep 17 00:00:00 2001 From: jaeh Date: Mon, 9 Oct 2023 16:24:31 +0200 Subject: [PATCH] docs: update --- docs/404.html | 2 +- docs/index.html | 2 +- docs/magic.css | 2 +- docs/magic.js | 37 ++++++++++++++++++++++++++++++++++++- docs/sitemap.xml | 4 ++-- docs/sri-hashes.json | 10 +++++----- 6 files changed, 46 insertions(+), 11 deletions(-) diff --git a/docs/404.html b/docs/404.html index 3900ea4..46a5f8f 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404 - not found

@magic/format

404 - not found.
made with a few bits of magic
\ No newline at end of file +404 - not found

@magic/format

404 - not found.
made with a few bits of magic
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 7fdf79e..51818ec 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -@magic/format

@magic/format

@magic/format

run prettier and format your code.

install

be in a nodejs project.

npm i --save-dev --save-exact @magic/format

Usage

npm run scripts

Add the @magic/test bin scripts to package.json

{  "scripts": {    "format": "f -w",    "format:check": "f"  },  "devDependencies": {    "@magic/format": "0.0.1"  }}

then use the npm run scripts

npm run formatnpm run format:check

cli

// first install globallynpm i -g @magic/format// check formatting using prettier but do not write// prettier --list-differentf// format files using prettier// prettier --writef -w
made with a few bits of magic
\ No newline at end of file +@magic/format

@magic/format

@magic/format

run prettier and format your code.

install

be in a nodejs project.

npm i --save-dev --save-exact @magic/format

Usage

npm run scripts

Add the @magic/test bin scripts to package.json

{  "scripts": {    "format": "f -w",    "format:check": "f"  },  "devDependencies": {    "@magic/format": "0.0.1"  }}

then use the npm run scripts

npm run formatnpm run format:check

cli

// first install globallynpm i -g @magic/format// check formatting using prettier but do not write// prettier --list-differentf// format files using prettier// prettier --writef -w
made with a few bits of magic
\ No newline at end of file diff --git a/docs/magic.css b/docs/magic.css index 4339f02..5fb1416 100644 --- a/docs/magic.css +++ b/docs/magic.css @@ -1 +1 @@ -h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;overflow-y:scroll;padding:0;scroll-behavior:smooth;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto;animation:showHoisted 500ms 0s forwards;opacity:0}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}@keyframes showHoisted{0%{opacity:0}100%{opacity:1}}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LightSwitch{bottom:2.5em;cursor:pointer;fill:#9E9E9E;left:0.5em;padding:0;position:fixed}.LightSwitch:hover{fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.NoSpy{bottom:0.5em;left:0.5em;position:fixed}.NoSpy .Background{height:100vh;width:100vw;overflow:hidden;left:0;top:0;position:fixed;padding:0;margin:0}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:absolute;text-align:left;left:0;bottom:0;width:20em;max-width:calc(100vw - 1em)}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .icon{position:absolute;left:0;bottom:0;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.NoSpy .icon:hover{color:#616161;stroke:#616161;fill:#616161}.NoSpy h3{padding:0;margin:0}.NoSpy input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;overflow-x:auto;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-1em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{width:0}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}*{box-sizing:border-box}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:1024px){.Header{box-sizing:border-box;height:100vh;max-height:100vh;overflow-y:auto;overflow-x:hidden;position:fixed;scrollbar-width:thin;width:210px}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px){.Header .Menu{float:left;width:auto}} \ No newline at end of file +h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,img,picture,source,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video,div,body{border:0;box-sizing:border-box;font:inherit;font-size:100%;margin:0;padding:0;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1.5;margin:0;max-width:100vw;overflow-x:hidden;overflow-y:scroll;padding:0;scroll-behavior:smooth;font-family:"Ubuntu Narrow",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,sans-serif}ul{display:inline-block;list-style:none}ol{display:inline-block;list-style:inside decimal}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}a{cursor:pointer;outline:none;white-space:nowrap;color:#eeeeee;text-decoration:underline;transition:color 500ms}b,strong{font-weight:700}i,em{font-style:italic}button,.button,input[type="reset"],input[type="button"],input[type="submit"],input[type="file"] > input[type="button"]{background-color:#9E9E9E;color:#212121;cursor:pointer;padding:0.5em}button:hover,.button:hover,input[type="reset"]:hover,input[type="button"]:hover,input[type="submit"]:hover,input[type="file"] > input[type="button"]:hover{background-color:#616161;color:#F5F5F5}button::-moz-focus-inner,.button::-moz-focus-inner,input[type="reset"]::-moz-focus-inner,input[type="button"]::-moz-focus-inner,input[type="submit"]::-moz-focus-inner,input[type="file"] > input[type="button"]::-moz-focus-inner{border:0 none;padding:0}#Magic{height:100%;min-height:100vh;width:100%;background-color:#232323;color:#cccccc;transition:color 300ms,background-color 300ms;font-weight:400}#Magic .icon{width:1.5em;height:auto;animation:showHoisted 500ms 0s forwards;opacity:0}.Wrapper{margin:0 auto;max-width:1300px;width:90%}.Header{display:inline-block;width:100%;padding:.5em 0 0}.Header .Logo{display:inline-block}.Header .Logo img{float:left}.Header .Logo span{float:left;font-size:1.5em;margin:.7em .2em}.Page h1{padding:1em 0 .2em}.Footer{width:100%;padding:2em 0 .5em;position:relative}h1,h2,h3,h4,h5{padding:1em 0 .2em}h1{font-size:1.4em}h2{font-size:1.3em}h3{font-size:1.2em}@keyframes showHoisted{0%{opacity:0}100%{opacity:1}}.Credits{clear:both;display:block;margin:2em 0 1em}.Credits a{color:#cccccc;text-decoration:underline}.Credits a:hover{color:#c4c4c4}.Footer .Container{text-align:center}.GitBadges{display:inline-block;margin:15px 0}.GitBadges img{height:23px}.GitBadges li{margin:0 .5em 0 0;display:inline-block;float:left}.Header .Menu{display:inline-block;width:100%}.Header p{font-size:1.5em}.LightSwitch{bottom:2.5em;cursor:pointer;fill:#9E9E9E;left:0.5em;padding:0;position:fixed}.LightSwitch:hover{fill:#616161}.Logo{float:left;height:2.4em}.Logo .stroke{fill:none;stroke:#663695;stroke-width:15;stroke-linecap:round;stroke-linejoin:round}.Logo .stroke.white{stroke:#ffffff}.Logo svg{display:inline-block;width:3em;height:auto}.Menu{float:none;margin:1.5em 0 0;position:relative;display:block;clear:both}.Menu li{float:none;margin:0 .5em 0 0;display:block}.Menu li.active > a{text-decoration:underline;color:#fefefe}.Menu li a{display:block;text-decoration:none}.Menu ul ul{position:relative;left:0;border-left:1px dotted;display:block;margin:0 0 0 0.2em;padding:0 0 0 0.3em}.NoSpy{bottom:0.5em;left:0.5em;position:fixed}.NoSpy .Background{height:100vh;width:100vw;overflow:hidden;left:0;top:0;position:fixed;padding:0;margin:0}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:absolute;text-align:left;left:0;bottom:0;width:20em;max-width:calc(100vw - 1em)}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .icon{position:absolute;left:0;bottom:0;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.NoSpy .icon:hover{color:#616161;stroke:#616161;fill:#616161}.NoSpy h3{padding:0;margin:0}.NoSpy input[type=button]{display:inline-block;margin:0.5em 0;width:100%}.Pre{background-color:#121212;border:1px solid #666;border-radius:5px;color:#eee;counter-reset:line;display:block;font-family:monospace;line-height:1.3;margin:1em 0;padding:1em .5em 0 .2em;position:relative;text-align:left;transition:color 300ms,background-color 300ms;white-space:pre}.Pre.lines pre > code{counter-increment:line;padding:0}.Pre.lines pre > code:last-child{padding:0 0 1em}.Pre.lines pre > code:before{content:counter(line);display:inline-block;padding:0 .5em 0 0;text-align:right;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:3ch}.Pre .actions{color:blueviolet}.Pre .boolean{color:#7979e4}.Pre .builtin{color:cadetblue}.Pre .colon{color:#8eef8e}.Pre .comment{opacity:0.7;font-style:italic}.Pre .html{color:#008800}.Pre .keyword{color:violet}.light .Pre{background-color:#ddd;color:#111}.light .Pre > code:before{color:#666}.light .Pre .html{color:#008800}.light .Pre .keyword{color:purple}.light .Pre .builtin{color:cadetblue}.light .Pre .string{color:#d15100}.light .Pre .colon{color:#016301}.light .Pre .boolean{color:blue}.light .Pre .actions{color:blueviolet}.light .Pre .state{color:cornflowerblue}.light .Pre .comment{color:#555;opacity:0.8;font-style:italic}.light .Pre .object{color:#016301}.light .Pre .property{color:#2a952a}.light .Pre a{color:#d15100}.light .Pre a:hover{color:turquoise}.Pre .menu{position:absolute;margin-top:-1em;right:0}.Pre .object{color:#00ff00}.Pre .property{color:#8eef8e}.Pre .state{color:cornflowerblue}.Pre .string{color:#dd8f00}.Pre > code:before{color:#666}.Pre a{color:turquoise}.Pre a:hover{color:#d15100}.Pre button{background-color:#666;border-radius:3px;color:#fefefe;margin:0 .2em;padding:1px 3px;border:0 none}.Pre pre{overflow-x:auto}.Pre pre > code{display:block;padding:0 1em 0}.Pre pre > code:last-child{padding:0 1em 1em}.SkipLink{height:1px;left:0;overflow:hidden;position:absolute;top:0;width:1px}*{box-sizing:border-box}#Magic.light{background-color:#eeeeee;color:#232323}h1:target,h2:target,h3:target,h4:target,h5:target{text-decoration:underline}:target > h1:first-child,:target > h2:first-child,:target > h3:first-child,:target > h4:first-child,:target > h5:first-child{text-decoration:underline}a:hover{color:#fefefe}.light a{color:#232323}.light a:hover{color:#232323}.Page{margin-bottom:3em}h4{font-size:1.1em}p{line-height:1.8}.light .Menu li.active > a{color:#232323}.Menu li.active li a{text-decoration:none}@media screen and (min-width:1024px){.Header{box-sizing:border-box;height:100vh;max-height:100vh;overflow-y:auto;overflow-x:hidden;position:fixed;scrollbar-width:thin;width:210px}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}.Menu{max-width:210px;padding:0 0 2em}.Page{float:right;width:calc(100% - 220px);min-height:83vh}.Footer{clear:both}}@media screen and (min-width:500px){.Header .Menu{float:left;width:auto}} \ No newline at end of file diff --git a/docs/magic.js b/docs/magic.js index 78da832..9196450 100644 --- a/docs/magic.js +++ b/docs/magic.js @@ -1 +1,36 @@ -function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function a(e,r){return t(e)||function(e,t){var n,r,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,c=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){c=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(c)throw r}}return i}}(e,r)||c(e,r)||n()}function c(t,n){if(t){if("string"==typeof t)return e(t,n);var r=Object.prototype.toString.call(t).slice(8,-1);if("Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return e(t,n)}}!function(){var e,l,s,u,f,p,d,m,h,v,g,y,b,w,k,x,C,O,j,A,S=(e={},s=(l=[]).map,u=Array.isArray,f="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout,p=function(e){var t="";if("string"==typeof e)return e;if(u(e)&&e.length>0)for(var n,r=0;rk)for(;v<=x;)t.insertBefore(y(m[v]=C(m[v++]),o,i),(c=p[h])&&c.node);else if(v>x)for(;h<=k;)t.removeChild(p[h++].node);else{for(var O=h,j={},A={};O<=k;O++)null!=(l=p[O].key)&&(j[l]=p[O]);for(;v<=x;){if(l=b(c=p[h]),s=b(m[v]=C(m[v],c)),A[l]||null!=s&&s===b(p[h+1])){null==l&&t.removeChild(c.node),h++;continue}null==s||1===n.type?(null==l&&(w(t,c&&c.node,c,m[v],o,i),v++),h++):(l===s?(w(t,c.node,c,m[v],o,i),A[s]=!0,h++):null!=(a=j[s])?(w(t,t.insertBefore(a.node,c&&c.node),a,m[v],o,i),A[s]=!0):w(t,c&&c.node,null,m[v],o,i),v++)}for(;h<=k;)null==b(c=p[h++])&&t.removeChild(c.node);for(var O in j)null==A[O]&&t.removeChild(j[O].node)}}return r.node=t},k=function(e,t){for(var n in e)if(e[n]!==t[n])return!0;for(var n in t)if(e[n]!==t[n])return!0},x=function(e){return"object"==typeof e?e:j(e)},C=function(e,t){return 2===e.type?((!t||!t.lazy||k(t.lazy,e.lazy))&&((t=x(e.lazy.view(e.lazy))).lazy=e.lazy),t):e},O=function(e,t,n,r,o,i){return{name:e,props:t,children:n,node:r,type:i,key:o}},j=function(t,n){return O(t,e,l,n,void 0,3)},A=function(t){return 3===t.nodeType?j(t.nodeValue,t):O(t.nodeName.toLowerCase(),e,s.call(t.childNodes,A),t,void 0,1)},{h:function(t,n){for(var r,o=[],i=[],a=arguments.length;a-- >2;)o.push(arguments[a]);for(;o.length>0;)if(u(r=o.pop()))for(var a=r.length;a-- >0;)o.push(r[a]);else!1===r||!0===r||null==r||i.push(x(r));return n=n||e,"function"==typeof t?t(n,i):O(t,n,i,void 0,n.key)},app:function(e){var t={},n=!1,r=e.view,o=e.node,i=o&&A(o),a=e.subscriptions,c=[],l=function(e){d(this.actions[e.type],e)},s=function(e){return t!==e&&(t=e,a&&(c=v(c,m([a(t)]),d)),r&&!n&&f(h,n=!0)),t},p=e.middleware,d=(void 0===p?function(e){return e}:p)(function(e,n){return"function"==typeof e?d(e(t,n)):u(e)?"function"==typeof e[0]||u(e[0])?d(e[0],"function"==typeof e[1]?e[1](n):e[1]):(m(e.slice(1)).map(function(e){e&&e[0](d,e[1])},s(e[0])),t):s(e)}),h=function(){n=!1,o=w(o.parentNode,o,i,i=x(r(t)),l)};d(e.init)}}),M=S.h,P=S.app,z=function(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0,r=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:[];return N({class:"Footer"},[B({class:"Container"},[B({class:"Credits"},["made with a few bits of ",er({to:"https://magic.github.io/",target:"_blank",rel:"noopener"},"magic")]),t])])},ee=function(e){if("string"==typeof e)e={project:e};else if(!e.project)return;var t=e.branch,n=void 0===t?"master":t,r=e.host,o=void 0===r?"github":r,i=e.project,c=void 0!==i&&i,l="",s=c;c.startsWith("@")?(l="@",c=c.substr(1)):s=c.split("/")[1];var u=[["npm",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return e&&{to:"https://www.npmjs.com/package/".concat(s),src:"https://img.shields.io/npm/v/".concat(l).concat(e,"?color=blue")}}],["node",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return e&&{src:"https://img.shields.io/node/v/".concat(l).concat(e,"?color=blue")}}],["license",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return e&&{src:"https://img.shields.io/npm/l/".concat(l).concat(e,"?color=blue")}}],["travis",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return e&&{to:"https://travis-ci.com/".concat(e),src:"https://img.shields.io/travis/com/".concat(e,"/").concat(n)}}],["appveyor",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;if(e){var t=a(e.split("/"),2),r=t[0],o=t[1];return r=r.replace(/-/g,""),{to:"https://ci.appveyor.com/project/".concat(r,"/").concat(o,"/branch/").concat(n),src:"https://img.shields.io/appveyor/ci/".concat(r,"/").concat(o,"/").concat(n,".svg")}}}],["coveralls",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return{to:"https://coveralls.io/".concat(o,"/").concat(e),src:"https://img.shields.io/coveralls/".concat(o,"/").concat(e,"/").concat(n,".svg")}}],["snyk",function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:c;return e&&{to:"https://snyk.io/test/".concat(o,"/").concat(e),src:"https://img.shields.io/snyk/vulnerabilities/github/".concat(e,".svg")}}]].map(function(t){var n=a(t,2),r=n[0];return(0,n[1])(e[r])});if(u.length)return X({class:"GitBadges"},u.map(function(e){var t=e.to,n=e.src;if(n){var r=en({src:n,height:"23"});return t?V(er({to:t},r)):V(r)}}))},et=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.logo,r=e.menu,o=e.logotext,i=e.hash,a=e.url;if(n||r||o)return U({class:"Header"},[eo(),o&&_(o),r&&ei({url:a,hash:i,menu:r}),t])},en=function(e){if("string"==typeof e&&(e={src:e}),e.src)return e.alt||(e.title?e.alt=e.title:(e.role="presentation",e.alt="",e.loading=e.loading||"lazy")),q(e)},er=function(e,t){var n=e.to,r=e.action,o=void 0===r?ef.go:r,a=e.text,c=i(e,["to","action","text"]),l=c.href,s=c.nofollow,u=c.noreferrer,f=i(c,["href","nofollow","noreferrer"]);return n=n||l||"",f.href=n,a&&t?a=[a,t]:a||(a=t||n),"/"===n[0]||"#"===n[0]?f.onclick=[o,eu.preventDefault]:(f.target="_blank",f.rel="noopener",s&&(f.rel+=" nofollow"),u&&(f.rel+=" noreferrer")),L(f,a)},eo=function(){return er({to:"/format/",class:"Logo"},[Q({viewBox:"0 0 512 444"},[J({d:"M512 444L256 0 0 444z",fill:"#663695"}),E({cx:"256",cy:"294",r:"130",fill:"#fff"}),E({cx:"256",cy:"281",r:"40",fill:"#663695"}),J({d:"M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2",class:"stroke"}),J({d:"M256 81v53m184 270l-43-29M72 404l43-29",class:"stroke white"})])])},ei=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.collapse,n=void 0===t||t,i=e.menu,a=e.hash,c=e.class,l=void 0===c?"":c,s=e.url;return l.includes("Menu")||(l="Menu ".concat(l).trim()),a&&!s.endsWith(a)&&(s+="#".concat(a)),H({className:l},X(i.map(function(e){return ea(o(r({},e),{url:s,collapse:n}))})))},ea=function(e){var t=e.collapse,n=e.items,o=void 0===n?[]:n,a=e.text,c=e.url,l=i(e,["collapse","items","text","url"]),s={class:{}},u=l.to;u===c&&(s.class.active=!0);var f=[];return(!t||c.includes(u))&&o.length&&(f=X(o.map(function(e){return ea(r({url:c,collapse:t},e))}))),V(s,[u?er(l,a):K(l,a),f])},ec=function(e){var t=e.nospy,n=void 0===t?{}:t;e.cookies;var r=n.show,o=n.title,i=void 0===o?"Privacy Notice":o,a=n.content,c=void 0===a?"This app neither saves, collects, nor shares any data about you.":a,l=n.buttonText;return r?B({class:"NoSpy"},[B({class:"Background",onclick:ef.nospy.toggle}),B({class:"Container"},[i&&F(i),c&&_(c),G({onclick:ef.nospy.toggle,value:void 0===l?"Awesome!":l,type:"button"})])]):B({class:"NoSpy"},Q({class:"icon",onclick:ef.nospy.toggle,width:"25",height:"25",viewBox:"0 0 512 512"},[D([J({d:"\nM507,208c-1-7-7-12-14-13c-7-1-13,3-16,9\nc-5,11-16,19-29,19c-14,0-26-10-30-23c-2-8-11-13-19-11\nC393,191,389,192,384,192c-35-0-64-29-64-64c0-5,1-9,2-14\nc2-8-3-16-11-19C297,90,288,78,288,64c-0-13,8-24,19-29\nc6-3,10-9,9-16c-1-7-6-12-13-14C288,2,272,0,256,0\nC115,0,0,115,0,256c0,141,115,256,256,256c141-0,256-115,256-256\nC512,239,510,224,507,209z M414,414C374,455,318,480,256,480s-118-25-158-66\nC57,374,32,318,32,256S57,138,98,98C138,57,194,32,256,32c3,0,6,0,9,0\nC259,42,256,52,256,64c0,24,13,44,33,55C288,122,288,125,288,128\nc0,53,43,96,96,96c3,0,6-0,8-0C403,242,424,256,448,256\nc11-0,22-3,32-8c0,3,0,6,0,9C480,318,455,374,414,414z\n"}),E({cx:"192",cy:"128",r:"32"}),E({cx:"128",cy:"256",r:"32"}),E({cx:"288",cy:"384",r:"32"}),E({cx:"272",cy:"272",r:"16"}),E({cx:"400",cy:"336",r:"16"}),E({cx:"176",cy:"368",r:"16"})])]))},el=function(e,t){var n=e.page,r=e.state;return Y({id:"Magic",class:r.pageClass},B({class:{Wrapper:!0}},[et(r),B({class:"Page",id:"page"},n(r)),Z(r),t]))},es=function(e,t){"string"==typeof e?e={content:e}:t?e=r({content:t},e):Array.isArray(e)&&(e={content:e.join("")});var n=e.content,o=e.lines,i=void 0===o||o;return B({class:{Pre:!0,lines:i&&"false"!==i}},[B({class:"menu"},[T({onclick:[ef.pre.clip,function(e){return{e:e,content:n}}]},"copy")]),$(n.trim().split("\n").map(es.Line))])};es.Comment=function(e){return K({class:"comment"},e)},es.Line=function(e){return W({class:"line"},es.Words(e))},es.Word=function(e){if(!e)return"";var t=e.includes("://"),n=e.startsWith("mailto:")||e.includes("@")&&e.includes(".");if(t||n)return er({to:e,text:e});var r="";return("state"===e?r="state":"actions"===e?r="actions":eu.pre.keywords.includes(e)?r="keyword":eu.pre.builtins.includes(e)?r="builtin":eu.pre.booleans.includes(e)&&(r="boolean"),r)?K({class:r},e):e},es.Words=function(e){var r,o=t(r=e.split(eu.pre.commentRegex))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||c(r)||n(),i=o[0],l=o.slice(1);if(!i.endsWith(":")&&l.length)return[es.Words(i),es.Comment(l.join("").split(eu.pre.wordRegex).map(es.Word))];var s=[],u=e;return(e.replace(eu.pre.stringRegex,function(e){if(u){var t=a(u.split(e),2),n=t[0],r=t[1];n&&s.push(n.split(eu.pre.wordRegex).map(es.Word).filter(function(e){return e})),u=r}s.push(K({class:"string"},e))}),u!==e)?(u&&s.push(u.split(eu.pre.wordRegex).map(es.Word).filter(function(e){return e})),s):e.split(eu.pre.wordRegex).filter(function(e){return e}).map(es.Word)};var eu={pre:{booleans:["true","false"],builtins:["Array","Object","String","Number","RegExp","Null","Symbol","Set","WeakSet","Map","WeakMap","setInterval","setTimeout","Promise","JSON","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],commentRegex:/(\/\/)/gim,keywords:["let","this","long","package","float","goto","private","class","if","short","while","protected","with","debugger","case","continue","volatile","interface","instanceof","super","synchronized","throw","extends","final","export","throws","try","import","double","enum","boolean","abstract","function","implements","typeof","transient","break","default","do","static","void","int","new","async","native","switch","else","delete","null","public","var","await","byte","finally","catch","in","return","for","get","const","char","module","exports","require","npm","install","=>"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function(e){return e.preventDefault(),e}},ef={changeTheme:function(e){return o(r({},e),{pageClass:o(r({},e.pageClass),{light:"dark"===e.theme}),theme:"dark"===e.theme?"light":"dark"})},go:function(e,t){var n=t.currentTarget.href.replace(window.location.origin,""),i=a(n.split("#"),2),c=i[0],l=i[1],s=void 0===l?"":l;if(c===e.url&&s===e.hash)return s&&(window.location.hash=s),e;var u=e.pages&&e.pages[c]&&e.pages[c].title;u&&(document.title=e.title=u),c!==e.url?s||window.scrollTo({top:0}):window.location.hash=s;var f=window.scrollY;return window.history.pushState({url:c,hash:s,scrollY:f},e.title,n),o(r({},e),{url:c,hash:s,prev:e.url})},nospy:{toggle:function(e){return e.nospy.show=!e.nospy.show,r({},e)}},pop:function(e,t){var n=window.location,i=n.pathname,a=n.hash;a=a.substring(1);var c=0;return t.state&&(i=t.state.url,a=t.state.hash,c=t.state.scrollY||0),a?window.location.hash=a:window.scroll({top:c}),o(r({},e),{url:i,hash:a})},pre:{clip:function(e,t){var n=t.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var r=document.createElement("textarea");r.id="copy",r.innerHTML=n,document.body.appendChild(r);var o=document.getElementById("copy");o.select(),document.execCommand("copy"),document.body.removeChild(o)}return e}}},ep={listenPopState:function(e,t){var n=function(n){return e(t,n)};return addEventListener("popstate",n),function(){return removeEventListener("popstate",n)}}},ed={"/format/":function(e){return[I(e.title),e.description.map(function(e){return _(e)}),ee("@magic/format"),R({id:"install"},"install"),_("be in a nodejs project."),es("npm i --save-dev --save-exact @magic/format"),R({id:"usage"},"Usage"),R({id:"usage-npm"},"npm run scripts"),_("Add the @magic/test bin scripts to package.json"),es('\n{\n "scripts": {\n "format": "f -w",\n "format:check": "f"\n },\n "devDependencies": {\n "@magic/format": "0.0.1"\n }\n}'),_("then use the npm run scripts"),es("\nnpm run format\nnpm run format:check\n "),F({id:"usage-cli"},"cli"),es("\n// first install globally\nnpm i -g @magic/format\n\n// check formatting using prettier but do not write\n// prettier --list-different\nf\n\n// format files using prettier\n// prettier --write\nf -w\n ")]},"/format/404/":function(){return B("404 - not found.")}};P({init:o(r({},{description:["run prettier and format your code."],logotext:"@magic/format",menu:[{text:"install",to:"/format/#install"},{items:[{text:"cli",to:"/format/#usage-cli"}],text:"usage",to:"/format/#usage"}],nospy:{show:!1},pageClass:{},pages:{"/format/404/":{description:"404 - not found.",title:"404 - not found"}},root:"/format/",theme:"dark",title:"@magic/format",url:"/format/"}),{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:function(e){return[[ep.listenPopState,ef.pop]]},view:function(e){var t=ed[e.url]?e.url:"/404/",n=ed[t],r=e.pages&&e.pages[t];return r&&Object.keys(r).forEach(function(t){e[t]=r[t]}),e.url=t,el({page:n,state:e},[ec(e),function(){return arguments.length>0&&void 0!==arguments[0]&&arguments[0],Q({class:"LightSwitch icon",onclick:ef.changeTheme,height:25,width:25,viewBox:"0 0 352 460"},[J({d:"M149 48C96 48 48 95 47 143c-1 13 19 17 20 0-1-35 48-75 83-75 15 0 12-22-1-20z"}),J({d:"M176 0C74 0 0 83 0 176c9 91 84 118 100 204h20c-16-92-97-138-100-204C22 70 105 21 176 20zM95 400c2 68 20 48 40 60h82c20-12 38 8 40-60z"}),J({d:"M175 0c102 0 177 83 177 176-9 91-86 118-102 204h-20c16-92 99-138 102-204-2-106-86-155-157-156z"})])}(e)])},node:document.getElementById("Magic")})}(); \ No newline at end of file +function e(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(()=>{let{h:n,app:o}=(()=>{var e={},t=[],r=t.map,n=Array.isArray,o="undefined"!=typeof requestAnimationFrame?requestAnimationFrame:setTimeout,i=function(e){var t="";if("string"==typeof e)return e;if(n(e)&&e.length>0)for(var r,o=0;ox)for(;k<=C;)t.insertBefore(u(b[k]=g(b[k++]),o,i),(s=v[w])&&s.node);else if(k>C)for(;w<=x;)t.removeChild(v[w++].node);else{for(var O=w,j={},$={};O<=x;O++)null!=(c=v[O].key)&&(j[c]=v[O]);for(;k<=C;){if(c=f(s=v[w]),m=f(b[k]=g(b[k],s)),$[c]||null!=m&&m===f(v[w+1])){null==c&&t.removeChild(s.node),w++;continue}null==m||1===r.type?(null==c&&(d(t,s&&s.node,s,b[k],o,i),k++),w++):(c===m?(d(t,s.node,s,b[k],o,i),$[m]=!0,w++):null!=(a=j[m])?(d(t,t.insertBefore(a.node,s&&s.node),a,b[k],o,i),$[m]=!0):d(t,s&&s.node,null,b[k],o,i),k++)}for(;w<=x;)null==f(s=v[w++])&&t.removeChild(s.node);for(var O in j)null==$[O]&&t.removeChild(j[O].node)}}return n.node=t},m=function(e,t){for(var r in e)if(e[r]!==t[r])return!0;for(var r in t)if(e[r]!==t[r])return!0},h=function(e){return"object"==typeof e?e:v(e)},g=function(e,t){return 2===e.type?((!t||!t.lazy||m(t.lazy,e.lazy))&&((t=h(e.lazy.view(e.lazy))).lazy=e.lazy),t):e},y=function(e,t,r,n,o,i){return{name:e,props:t,children:r,node:n,type:i,key:o}},v=function(r,n){return y(r,e,t,n,void 0,3)},b=function(t){return 3===t.nodeType?v(t.nodeValue,t):y(t.nodeName.toLowerCase(),e,r.call(t.childNodes,b),t,void 0,1)};return{h:function(t,r){for(var o,i=[],l=[],a=arguments.length;a-- >2;)i.push(arguments[a]);for(;i.length>0;)if(n(o=i.pop()))for(var a=o.length;a-- >0;)i.push(o[a]);else!1===o||!0===o||null==o||l.push(h(o));return r=r||e,"function"==typeof t?t(r,l):y(t,r,l,void 0,r.key)},app:function(e){var t={},r=!1,i=e.view,l=e.node,s=l&&b(l),p=e.subscriptions,u=[],f=function(e){y(this.actions[e.type],e)},m=function(e){return t!==e&&(t=e,p&&(u=c(u,a([p(t)]),y)),i&&!r&&o(v,r=!0)),t};let{middleware:g=e=>e}=e,y=g((e,r)=>"function"==typeof e?y(e(t,r)):n(e)?"function"==typeof e[0]||n(e[0])?y(e[0],"function"==typeof e[1]?e[1](r):e[1]):(a(e.slice(1)).map(function(e){e&&e[0](y,e[1])},m(e[0])),t):m(e));var v=function(){r=!1,l=d(l.parentNode,l,s,s=h(i(t)),f)};y(e.init)}}})(),i=e=>(t={},r)=>{let o=(e,...t)=>t.some(t=>t===typeof e);if(o(r,"undefined")){if(t.props)return n(e,{},[t]);o(t,"string","number","function")||Array.isArray(t)?(r=t,t={}):o(t.View,"function")&&(r=t.View,t={})}return n(e,t,r)},l=i("a");i("abbr"),i("address"),i("animate"),i("animateMotion"),i("animateTransform"),i("area"),i("article"),i("aside"),i("audio"),i("b"),i("base"),i("bdi"),i("bdo"),i("blockquote"),i("body"),i("br");let a=i("button");i("canvas"),i("caption");let s=i("circle");i("cite"),i("clipPath");let c=i("code");i("col"),i("colgroup"),i("data"),i("datalist"),i("dd"),i("defs"),i("del"),i("desc"),i("description"),i("details"),i("dfn"),i("dialog"),i("discard");let p=i("div");i("dl"),i("dt"),i("ellipse"),i("em"),i("embed"),i("feBlend"),i("feColorMatrix"),i("feComponentTransfer"),i("feComposite"),i("feConvolveMatrix"),i("feDiffuseLighting"),i("feDisplacementMap"),i("feDistantLight"),i("feDropShadow"),i("feFlood"),i("feFuncA"),i("feFuncB"),i("feFuncG"),i("feFuncR"),i("feGaussianBlur"),i("feImage"),i("feMerge"),i("feMergeNode"),i("feMorphology"),i("feOffset"),i("fePointLight"),i("feSpecularLighting"),i("feSpotLight"),i("feTile"),i("feTurbulence"),i("fieldset"),i("figcaption"),i("figure"),i("filter");let u=i("footer");i("foreignObject"),i("form");let f=i("g"),d=i("h1"),m=i("h2"),h=i("h3");i("h4"),i("h5"),i("h6"),i("hatch"),i("hatchpath"),i("head");let g=i("header");i("hgroup"),i("hr"),i("html"),i("i"),i("iframe"),i("image");let y=i("img"),v=i("input");i("ins"),i("kbd"),i("label"),i("legend");let b=i("li");i("line"),i("linearGradient"),i("link");let w=i("main");i("map"),i("mark"),i("marker"),i("mask"),i("mesh"),i("meshgradient"),i("meshpatch"),i("meshrow"),i("meta"),i("metadata"),i("meter"),i("mpath");let k=i("nav");i("noscript"),i("object"),i("ol"),i("optgroup"),i("option"),i("output");let x=i("p");i("param");let C=i("path");i("pattern"),i("picture"),i("polygon"),i("polyline");let O=i("pre");i("progress"),i("q"),i("radialGradient"),i("rb"),i("rect"),i("rp"),i("rt"),i("rtc"),i("ruby"),i("s"),i("samp"),i("script"),i("section"),i("select"),i("set"),i("small"),i("solidcolor"),i("source");let j=i("span");i("stop"),i("strong"),i("style"),i("sub"),i("summary"),i("sup");let $=i("svg");i("symbol"),i("table"),i("tbody"),i("td"),i("template"),i("text"),i("textPath"),i("textarea"),i("tfoot"),i("th"),i("thead"),i("time"),i("title"),i("tr"),i("track"),i("tspan"),i("u");let M=i("ul");i("unknown"),i("use"),i("video"),i("view"),i("wbr");let P=()=>p({class:"Credits"},["made with a few bits of ",E({to:"https://magic.github.io/",target:"_blank",rel:"noopener"},"magic")]),A=(e,t=[])=>u({class:"Footer"},[p({class:"Container"},[P(),t])]),S=e=>{if("string"==typeof e)e={project:e};else if(!e.project)return;let{branch:t="master",host:r="github"}=e,{project:n=!1}=e,o="",i=n;n.startsWith("@")?(o="@",n=n.substr(1)):i=n.split("/")[1];let l=[["npm",(e=n)=>e&&{to:`https://www.npmjs.com/package/${i}`,src:`https://img.shields.io/npm/v/${o}${e}?color=blue`}],["node",(e=n)=>e&&{src:`https://img.shields.io/node/v/${o}${e}?color=blue`}],["license",(e=n)=>e&&{src:`https://img.shields.io/npm/l/${o}${e}?color=blue`}],["travis",(e=n)=>e&&{to:`https://travis-ci.com/${e}`,src:`https://img.shields.io/travis/com/${e}/${t}`}],["appveyor",(e=n)=>{if(e){let[r,n]=e.split("/");return{to:`https://ci.appveyor.com/project/${r=r.replace(/-/g,"")}/${n}/branch/${t}`,src:`https://img.shields.io/appveyor/ci/${r}/${n}/${t}.svg`}}}],["coveralls",(e=n)=>({to:`https://coveralls.io/${r}/${e}`,src:`https://img.shields.io/coveralls/${r}/${e}/${t}.svg`})],["snyk",(e=n)=>e&&{to:`https://snyk.io/test/${r}/${e}`,src:`https://img.shields.io/snyk/vulnerabilities/github/${e}.svg`}]].map(([t,r])=>r(e[t]));if(l.length)return M({class:"GitBadges"},l.map(({to:e,src:t})=>{if(!t)return;let r=L({src:t,height:"23"});return e?b(E({to:e},r)):b(r)}))},z=(e={},t=[])=>{let{logo:r,menu:n,logotext:o,hash:i,url:l}=e;if(r||n||o)return g({class:"Header"},[T(),o&&x(o),n&&B({url:l,hash:i,menu:n}),t])},L=e=>{"string"==typeof e&&(e={src:e});let{loading:t="lazy"}=e;if(e.src)return e.hasOwnProperty("alt")||(e.title?e.alt=e.title:e.alt=""),e.loading=t,y(e)},W=(e={})=>$({class:"LightSwitch icon",onclick:q.changeTheme,height:25,width:25,viewBox:"0 0 352 460"},[C({d:"M149 48C96 48 48 95 47 143c-1 13 19 17 20 0-1-35 48-75 83-75 15 0 12-22-1-20z"}),C({d:"M176 0C74 0 0 83 0 176c9 91 84 118 100 204h20c-16-92-97-138-100-204C22 70 105 21 176 20zM95 400c2 68 20 48 40 60h82c20-12 38 8 40-60z"}),C({d:"M175 0c102 0 177 83 177 176-9 91-86 118-102 204h-20c16-92 99-138 102-204-2-106-86-155-157-156z"})]),E=(e,t)=>{var{to:n,action:o=q.go,text:i}=e,a=r(e,["to","action","text"]);let{href:s,nofollow:c,noreferrer:p}=a,u=r(a,["href","nofollow","noreferrer"]);n=n||s||"",u.href=n,i&&t?i=[i,t]:i||(i=t||n);let f="/"===n[0]||"#"===n[0];return f?u.onclick=[o,I.preventDefault]:(u.target="_blank",u.rel="noopener",c&&(u.rel+=" nofollow"),p&&(u.rel+=" noreferrer")),l(u,i)},T=()=>E({to:"/format/",class:"Logo"},[$({viewBox:"0 0 512 444"},[C({d:"M512 444L256 0 0 444z",fill:"#663695"}),s({cx:"256",cy:"294",r:"130",fill:"#fff"}),s({cx:"256",cy:"281",r:"40",fill:"#663695"}),C({d:"M256 350v44m24-44l1 13c1 27 29 27 29-7m-160-72s46-47 106-47c59 0 106 47 106 47s-47 43-106 43c-60 0-106-43-106-43zm65-75a134 134 0 0189 2",class:"stroke"}),C({d:"M256 81v53m184 270l-43-29M72 404l43-29",class:"stroke white"})])]),B=(r={})=>{let{collapse:n=!0,menu:o,hash:i}=r,{class:l="",url:a}=r;return l.includes("Menu")||(l=`Menu ${l}`.trim()),i&&!a.endsWith(i)&&(a+=`#${i}`),k({className:l},M(o.map(r=>D(t(e({},r),{url:a,collapse:n})))))},D=t=>{let{collapse:n,items:o=[],text:i,url:l}=t,a=r(t,["collapse","items","text","url"]),s={class:{}},{to:c}=a;c===l&&(s.class.active=!0);let p=[],u=!n||l.includes(c);return u&&o.length&&(p=M(o.map(t=>D(e({url:l,collapse:n},t))))),b(s,[c?E(a,i):j(a,i),p])},N=({nospy:e={},cookies:t=[]})=>{let{show:r,title:n="Privacy Notice",content:o="This app neither saves, collects, nor shares any data about you.",buttonText:i="Awesome!"}=e;return r?p({class:"NoSpy"},[p({class:"Background",onclick:q.nospy.toggle}),p({class:"Container"},[n&&h(n),o&&x(o),v({onclick:q.nospy.toggle,value:i,type:"button"})])]):p({class:"NoSpy"},$({class:"icon",onclick:q.nospy.toggle,width:"25",height:"25",viewBox:"0 0 512 512"},[f([C({d:` +M507,208c-1-7-7-12-14-13c-7-1-13,3-16,9 +c-5,11-16,19-29,19c-14,0-26-10-30-23c-2-8-11-13-19-11 +C393,191,389,192,384,192c-35-0-64-29-64-64c0-5,1-9,2-14 +c2-8-3-16-11-19C297,90,288,78,288,64c-0-13,8-24,19-29 +c6-3,10-9,9-16c-1-7-6-12-13-14C288,2,272,0,256,0 +C115,0,0,115,0,256c0,141,115,256,256,256c141-0,256-115,256-256 +C512,239,510,224,507,209z M414,414C374,455,318,480,256,480s-118-25-158-66 +C57,374,32,318,32,256S57,138,98,98C138,57,194,32,256,32c3,0,6,0,9,0 +C259,42,256,52,256,64c0,24,13,44,33,55C288,122,288,125,288,128 +c0,53,43,96,96,96c3,0,6-0,8-0C403,242,424,256,448,256 +c11-0,22-3,32-8c0,3,0,6,0,9C480,318,455,374,414,414z +`}),s({cx:"192",cy:"128",r:"32"}),s({cx:"128",cy:"256",r:"32"}),s({cx:"288",cy:"384",r:"32"}),s({cx:"272",cy:"272",r:"16"}),s({cx:"400",cy:"336",r:"16"}),s({cx:"176",cy:"368",r:"16"})])]))},R=({page:e,state:t},r)=>{let n={id:"Magic",class:t.pageClass};return w(n,p({class:{Wrapper:!0}},[z(t),p({class:"Page",id:"page"},e(t)),A(t),r]))},F=(t,r)=>{"string"==typeof t?t={content:t}:r?t=e({content:r},t):Array.isArray(t)&&(t={content:t.join("")});let{content:n,lines:o=!0}=t;return p({class:{Pre:!0,lines:o&&"false"!==o}},[p({class:"menu"},[a({onclick:[q.pre.clip,e=>({e,content:n})]},"copy")]),O(n.trim().split("\n").map(F.Line))])};F.Comment=e=>j({class:"comment"},e),F.Line=e=>c({class:"line"},F.Words(e)),F.Word=e=>{if(!e)return"";let t=e.includes("://"),r=e.startsWith("mailto:")||e.includes("@")&&e.includes(".");if(t||r)return E({to:e,text:e});let n="";return("state"===e?n="state":"actions"===e?n="actions":"effects"===e?n="effects":"subscriptions"===e?n="subscriptions":I.pre.keywords.includes(e)?n="keyword":I.pre.builtins.includes(e)?n="builtin":I.pre.booleans.includes(e)&&(n="boolean"),n)?j({class:n},e):e},F.Words=e=>{let[t,...r]=e.split(I.pre.commentRegex),n=!t.endsWith(":")&&r.length;if(n)return[F.Words(t),F.Comment(r.join("").split(I.pre.wordRegex).map(F.Word))];let o=[],i=e;if(e.replace(I.pre.stringRegex,e=>{if(i){let[t,r]=i.split(e);t&&o.push(t.split(I.pre.wordRegex).map(F.Word).filter(e=>e)),i=r}o.push(j({class:"string"},e))}),i!==e)return i&&o.push(i.split(I.pre.wordRegex).map(F.Word).filter(e=>e)),o;let l=e.split(I.pre.wordRegex).filter(e=>e);return l.map(F.Word)};let I={pre:{booleans:["true","false"],builtins:["Array","Object","String","Number","RegExp","Null","Symbol","Set","WeakSet","Map","WeakMap","setInterval","setTimeout","Promise","JSON","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"],commentRegex:/(\/\/)/gim,keywords:["let","this","long","package","float","goto","private","class","if","short","while","protected","with","debugger","case","continue","volatile","interface","instanceof","super","synchronized","throw","extends","final","export","throws","try","import","double","enum","boolean","abstract","function","implements","typeof","transient","break","default","do","static","void","int","new","async","native","switch","else","delete","null","public","var","await","byte","finally","catch","in","return","for","get","const","char","module","exports","require","npm","install","=>"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:e=>(e.preventDefault(),e)},q={changeTheme:r=>t(e({},r),{pageClass:t(e({},r.pageClass),{light:"dark"===r.theme}),theme:"dark"===r.theme?"light":"dark"}),go:(r,n)=>{let o=n.currentTarget.href.replace(window.location.origin,""),[i,l=""]=o.split("#");if(i===r.url&&l===r.hash)return l&&(window.location.hash=l),r;let a=r.pages&&r.pages[i]&&r.pages[i].title;a&&(document.title=r.title=a),i!==r.url?l||window.scrollTo({top:0}):window.location.hash=l;let{scrollY:s}=window;return window.history.pushState({url:i,hash:l,scrollY:s},r.title,o),t(e({},r),{url:i,hash:l,prev:r.url})},nospy:{toggle:t=>(t.nospy.show=!t.nospy.show,e({},t))},pop:(r,n)=>{let{pathname:o,hash:i}=window.location;i=i.substring(1);let l=0;return n.state&&(o=n.state.url,i=n.state.hash,l=n.state.scrollY||0),i?window.location.hash=i:window.scroll({top:l}),t(e({},r),{url:o,hash:i})},pre:{clip:(e,{content:t})=>{if("undefined"!=typeof document&&"function"==typeof document.execCommand){let e=document.createElement("textarea");e.id="copy",e.innerHTML=t,document.body.appendChild(e);let r=document.getElementById("copy");r.select(),document.execCommand("copy"),document.body.removeChild(r)}return e}}},G={listenPopState:(e,t)=>{let r=r=>e(t,r);return addEventListener("popstate",r),()=>removeEventListener("popstate",r)}},U={"/format/":e=>[d(e.title),e.description.map(e=>x(e)),S("@magic/format"),m({id:"install"},"install"),x("be in a nodejs project."),F("npm i --save-dev --save-exact @magic/format"),m({id:"usage"},"Usage"),m({id:"usage-npm"},"npm run scripts"),x("Add the @magic/test bin scripts to package.json"),F(` +{ + "scripts": { + "format": "f -w", + "format:check": "f" + }, + "devDependencies": { + "@magic/format": "0.0.1" + } +}`),x("then use the npm run scripts"),F(` +npm run format +npm run format:check + `),h({id:"usage-cli"},"cli"),F(` +// first install globally +npm i -g @magic/format + +// check formatting using prettier but do not write +// prettier --list-different +f + +// format files using prettier +// prettier --write +f -w + `)],"/format/404/":()=>p("404 - not found.")};o({init:t(e({},{description:["run prettier and format your code."],logotext:"@magic/format",menu:[{text:"install",to:"/format/#install"},{items:[{text:"cli",to:"/format/#usage-cli"}],text:"usage",to:"/format/#usage"}],nospy:{show:!1},pageClass:{},pages:{"/format/404/":{description:"404 - not found.",title:"404 - not found"}},root:"/format/",theme:"dark",title:"@magic/format",url:"/format/"}),{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:e=>[[G.listenPopState,q.pop]],view:e=>{let t=U[e.url]?e.url:"/404/",r=U[t],n=e.pages&&e.pages[t];return n&&Object.keys(n).forEach(t=>{e[t]=n[t]}),e.url=t,R({page:r,state:e},[N(e),W(e)])},node:document.getElementById("Magic")})})(); \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index df763d3..0b4f194 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -7,14 +7,14 @@ https:/magic.github.io/format/ - 2023-02-16 + 2023-10-09 weekly 0.5 https:/magic.github.io/format/404/ - 2023-02-16 + 2023-10-09 weekly 0.5 diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index dbdce3d..a59e042 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,8 +1,8 @@ { - "/magic.css": "sha384-hL6TXJdzG/fcaSNzABDqHDUb/WCFv0/yX6F7PSMTKd6ufwTeHxr6WXubO7NFwpsH", - "/magic.js": "sha384-y6+qEJEJmju8CT+Xtapg9BdSlNU3zvt9CHd7lcKPvRGqOi6VyClgG5JX5i0AIJPN", - "/format/": "sha384-/6EDx6iWtGJQKlVaLL5XL2bgfOXPCndMBdFZgbTRUb91ZOoeQcxDb34PLSkngl5V", - "/format/404/": "sha384-SJRWW+JeFdnKH69Ip2MdqFgick7Iu7NBTV5Zw60fC5/i+3cXkZ59e/zFwXrX8FPi", + "/magic.css": "sha384-fuYRy10jiIv65W7WfSmnIdUpn4j2LaceRHTeNaXLwvkt9QCfZ5jAv5cjjO3PIB1R", + "/magic.js": "sha384-WN28I6uI4BXUgrb4MHkQfKnACcP4s2JnF460965nAye/Dl7GKqT6nz9XpqWecO6u", + "/format/": "sha384-Gsbdv4k79Bd0SicbgBkkOXcvz3YuiRwOVlTi84ZqRnBBKYHrv6F7+4nWh2AH2+El", + "/format/404/": "sha384-jQZTmJF5HrMtD/cFTqGyrTgtjvDRqXLCAmn1ucKGJKBV89xS/E8CkMsGowEzC3E+", "/robots.txt": "sha384-aRIdBGDklH+1P/yf6qm9zEp5FWTGukgFu4nsDpZbYC8KS9Pa1n2+F8POtE+GBbPu", - "/sitemap.xml": "sha384-ilkAkJOxcLKz2SMEEU2cDE5HwCrKsi9YrGq/6l4JDawCOR1Ngi5oFG+qUoE/yC/u" + "/sitemap.xml": "sha384-UWJ9PInMcu2N4v5d//JX4pSYhIpke46QdPqlCYqQfxtExh/nFupGTM9r/yg8U4bR" } \ No newline at end of file