diff --git a/docs/404.html b/docs/404.html index a78ed72..07aed3a 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1 +1 @@ -404 - not found

@magic/format

404 - not found.
\ No newline at end of file +404 - not found

@magic/format

404 - not found.
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index aff4097..a409280 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
\ 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
\ No newline at end of file diff --git a/docs/magic.css b/docs/magic.css index f92c148..cc3e27a 100644 --- a/docs/magic.css +++ b/docs/magic.css @@ -1 +1 @@ -html{scroll-behavior:smooth;overflow-y:scroll}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;padding:0;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}.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}.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{background:none;border:none;color:inherit;cursor:pointer;fill:#9E9E9E;font:inherit;height:2em;outline:inherit;padding:0;width:2em;left:auto;position:fixed;right:0.5em;top:0.5em}.LightSwitch:hover{background:none;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{-webkit-animation:showNoSpy 1s 1s forwards;animation:showNoSpy 1s 1s forwards;bottom:0.5em;left:3%;max-width:94%;opacity:0;position:fixed;text-align:center}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:relative;text-align:left}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .ShowHide{position:fixed;left:1em;bottom:1em;width:2em;height:2em;cursor:pointer;color:#9E9E9E;stroke:#9E9E9E;fill:#9E9E9E}.NoSpy .ShowHide: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%}@-webkit-keyframes showNoSpy{0%{opacity:0}100%{opacity:1}}@keyframes showNoSpy{0%{opacity:0}100%{opacity:1}}.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;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;-ms-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:-2em;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}#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{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.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{width:auto;float:left}}@media screen and (min-width:900px){.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}} \ No newline at end of file +html{scroll-behavior:smooth;overflow-y:scroll}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;padding:0;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}.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}.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{background:none;border:none;color:inherit;cursor:pointer;fill:#9E9E9E;font:inherit;outline:inherit;padding:0;left:0.5em;position:fixed;bottom:2.5em}.LightSwitch:hover{background:none;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{-webkit-animation:showNoSpy 1s 1s forwards;animation:showNoSpy 1s 1s forwards;bottom:0.5em;left:0.5em;opacity:0;position:fixed}.NoSpy .Container{background-color:#212121;border:1px solid;border-radius:.5em;color:#F5F5F5;display:inline-block;padding:1em;position:relative;text-align:left}.light .NoSpy .Container{background-color:#F5F5F5;color:#212121}.NoSpy .icon{position:fixed;left:1em;bottom:1em;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%}@-webkit-keyframes showNoSpy{0%{opacity:0}100%{opacity:1}}@keyframes showNoSpy{0%{opacity:0}100%{opacity:1}}.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;-ms-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:-2em;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}#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}.Gpdr svg.icon,.NoSpy svg.icon{left:0.5em;bottom:0.5em}@media screen and (min-width:1024px){.Header{width:210px;position:fixed;float:left;max-height:100vh;height:100vh;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;box-sizing:border-box}.Header p{font-size:1em}.Header .Menu{max-width:210px;padding:0 0 2em}.Logo{float:none}.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{width:auto;float:left}}@media screen and (min-width:900px){.NoSpy input[type=button]{margin:1em 3% 0 0;max-width:30%;width:auto}} \ No newline at end of file diff --git a/docs/magic.js b/docs/magic.js index 566c4cf..05b882b 100644 --- a/docs/magic.js +++ b/docs/magic.js @@ -1 +1 @@ -"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a}},ma={changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},nospy:{close:function close(a){return j(j({},a),{},{nospy:j(j({},a.nospy),{},{show:!1})})},show:function(a,b){var c=b.show;return"boolean"==typeof c?j(j({},a),{},{nospy:j(j({},a.nospy),{},{show:c})}):a}},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},na={"/format/":function format(a){return[g(a.title),a.description.map(function(a){return M(a)}),_("@magic/format"),B({id:"install"},"install"),M("be in a nodejs project."),ka("npm i --save-dev --save-exact @magic/format"),B({id:"usage"},"Usage"),B({id:"usage-npm"},"npm run scripts"),M("Add the @magic/test bin scripts to package.json"),ka("\n{\n \"scripts\": {\n \"format\": \"f -w\",\n \"format:check\": \"f\"\n },\n \"devDependencies\": {\n \"@magic/format\": \"0.0.1\"\n }\n}"),M("then use the npm run scripts"),ka("\nnpm run format\nnpm run format:check\n "),C({id:"usage-cli"},"cli"),ka("\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 format404(){return y("404 - not found.")}};h({init:j(j({},U),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:function subscriptions(){return[[V.listenPopState,ma.pop]]},view:function(a){var b=na[a.url]?a.url:"/404/",c=na[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,ja({page:c,state:a},[ia(a),ca(a)])},node:document.getElementById("Magic")}); \ No newline at end of file +"use strict";function b(a){return s(a)||c(a)||n(a)||m()}function c(a){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)}function d(a,b){if(null==a)return{};var c,d,f=e(a,b);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(a);for(d=0;da.length)&&(b=a.length);for(var c=0,d=Array(b);cy)for(;x<=z;)c.insertBefore(p(u[x]=v(u[x++]),f,g),(k=t[w])&&k.node);else if(x>z)for(;w<=y;)c.removeChild(t[w++].node);else{for(var A=w,B={},C={};A<=y;A++)null!=(l=t[A].key)&&(B[l]=t[A]);for(;x<=z;){if(l=q(k=t[w]),m=q(u[x]=v(u[x],k)),C[l]||null!=m&&m===q(t[w+1])){null==l&&c.removeChild(k.node),w++;continue}null==m||1===d.type?(null==l&&(r(c,k&&k.node,k,u[x],f,g),x++),w++):(l===m?(r(c,k.node,k,u[x],f,g),C[m]=!0,w++):null==(h=B[m])?r(c,k&&k.node,null,u[x],f,g):(r(c,c.insertBefore(h.node,k&&k.node),h,u[x],f,g),C[m]=!0),x++)}for(;w<=y;)null==q(k=t[w++])&&c.removeChild(k.node);for(var A in B)null==C[A]&&c.removeChild(B[A].node)}}return e.node=c},s=function(c,a){for(var b in c)if(c[b]!==a[b])return!0;for(var b in a)if(c[b]!==a[b])return!0},u=function(a){return"object"===t(a)?a:x(a)},v=function(b,c){return b.type===a?((!c||!c.lazy||s(c.lazy,b.lazy))&&((c=u(b.lazy.view(b.lazy))).lazy=b.lazy),c):b},w=function(a,b,c,d,e,f){return{name:a,props:b,children:c,node:d,type:f,key:e}},x=function(a,e){return w(a,c,d,e,void 0,b)},y=function(a){return a.nodeType===b?x(a.nodeValue,a):w(a.nodeName.toLowerCase(),c,e.call(a.childNodes,y),a,void 0,1)};return{h:function h(a,b){for(var d,e=[],g=[],h=arguments.length;2"],stringRegex:/("|')(.*?)\1/gim,wordRegex:/( )/gim},preventDefault:function preventDefault(a){return a.preventDefault(),a}},ma={changeTheme:function changeTheme(a){return j(j({},a),{},{pageClass:j(j({},a.pageClass),{},{light:"dark"===a.theme}),theme:"dark"===a.theme?"light":"dark"})},go:function go(a,b){var c=b.currentTarget.href.replace(window.location.origin,""),d=c.split("#"),e=l(d,2),f=e[0],g=e[1],h=void 0===g?"":g;if(f===a.url&&h===a.hash)return h&&(window.location.hash=h),a;var i=window,k=i.scrollY,m=a.pages&&a.pages[f]&&a.pages[f].title;if(m&&(document.title=a.title=m),f===a.url)window.location.hash=h;else if(!h){var n=document.getElementsByTagName("html"),o=l(n,1),p=o[0],q=p.style.scrollBehavior;p.style.scrollBehavior="auto",window.scrollTo({top:0,behavior:"smooth"}),p.style.scrollBehavior=q}return window.history.pushState({url:f,hash:h,scrollY:k},a.title,c),j(j({},a),{},{url:f,hash:h,prev:a.url})},nospy:{close:function close(a){return j(j({},a),{},{nospy:j(j({},a.nospy),{},{show:!1})})},show:function(a,b){var c=b.show;return"boolean"==typeof c?j(j({},a),{},{nospy:j(j({},a.nospy),{},{show:c})}):a}},pop:function pop(a,b){var c=window.location,d=c.pathname,e=c.hash;e=e.substring(1);var f=0;return b.state&&(d=b.state.url,e=b.state.hash,f=b.state.scrollY||0),e?window.location.hash=e:window.scroll({top:f,behavior:"smooth"}),j(j({},a),{},{url:d,hash:e})},pre:{clip:function clip(a,b){var c=b.content;if("undefined"!=typeof document&&"function"==typeof document.execCommand){var d=document.createElement("textarea");d.id="copy",d.innerHTML=c,document.body.appendChild(d);var e=document.getElementById("copy");e.select(),document.execCommand("copy"),document.body.removeChild(e)}return a}}},na={"/format/":function format(a){return[g(a.title),a.description.map(function(a){return M(a)}),_("@magic/format"),B({id:"install"},"install"),M("be in a nodejs project."),ka("npm i --save-dev --save-exact @magic/format"),B({id:"usage"},"Usage"),B({id:"usage-npm"},"npm run scripts"),M("Add the @magic/test bin scripts to package.json"),ka("\n{\n \"scripts\": {\n \"format\": \"f -w\",\n \"format:check\": \"f\"\n },\n \"devDependencies\": {\n \"@magic/format\": \"0.0.1\"\n }\n}"),M("then use the npm run scripts"),ka("\nnpm run format\nnpm run format:check\n "),C({id:"usage-cli"},"cli"),ka("\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 format404(){return y("404 - not found.")}};h({init:j(j({},U),{},{url:window.location.pathname,hash:window.location.hash.substr(1)}),subscriptions:function subscriptions(){return[[V.listenPopState,ma.pop]]},view:function(a){var b=na[a.url]?a.url:"/404/",c=na[b],d=a.pages&&a.pages[b];return d&&Object.keys(d).forEach(function(b){a[b]=d[b]}),a.url=b,ja({page:c,state:a},[ia(a),ca(a)])},node:document.getElementById("Magic")}); \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml index e2fdd61..ee58f30 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -7,14 +7,14 @@ https://magic.github.io/format/ - 2020-07-17 + 2020-07-18 weekly 0.5 https://magic.github.io/format/404/ - 2020-07-17 + 2020-07-18 weekly 0.5 diff --git a/docs/sri-hashes.json b/docs/sri-hashes.json index ad95468..97d39c9 100644 --- a/docs/sri-hashes.json +++ b/docs/sri-hashes.json @@ -1,8 +1,8 @@ { - "/magic.css": "sha384-m0rgTTR+NsZCatxTILqr/RPlnxFUoZCNn4QReZM3/rWmDWIkdbxVJyOsaKE82Pm/", - "/magic.js": "sha384-Nt1Bw90EL7qI2IfqIQMNQ6rwgUOB1UL7+yzYWjjJldSZAxs2NFweC8s/1JgVcRk8", - "/format/": "sha384-+PO3yeepDfCBVDGehK8kJqF9JV7q/Cpvs+OQtxQwhva6yRhdH9Ec3FADJ9KQCnB7", - "/format/404/": "sha384-ySvYsPx+Zow+Ptnfpe2h291QcIAsdxdjIIHB2kMHQ/Wm7+8KczJeG/BhxwDX3FMs", + "/magic.css": "sha384-/dz1c7J6y42E0eCzAv8FlX5isd3GiPVlvRYzwxVc31ZmoxOnFREg0knYaEWedM33", + "/magic.js": "sha384-Cc6yLff8C8Nw1532ZcMP40iNJwFdBNAkWA12rmllqYQnlhnGvM1M5Kc1UXnL8kJy", + "/format/": "sha384-3EZGHcqLF2vdF3Sk0pKf6Ic3DKLDkIyQGICdftwoKWJeCK2ILRGRg/J2o1FOINem", + "/format/404/": "sha384-zIAQXJhZ61Q8A3NCAk6yre6FgzUSPoIaJAEcX8X4s1aAbKCNZj5+7sIqvf1Q5n86", "/robots.txt": "sha384-P5Iu+9vLJ7MpKWWSn3ADonFg4Dkfks9vAn8aIE1GSji1UazSLeJSW/dCoZ/j60wd", - "/sitemap.xml": "sha384-ETNqogMclMUYm2g/icdhg+8FbIgzMbZJxJGTT6fDaFejFE8LZ5jXuj6/UGABUOay" + "/sitemap.xml": "sha384-rmt4tmA6R+30romr+tJ5DpEPDmftS03+AQoVIqXZLiF6iWZTRfkFg1bt+mL/D4y/" } \ No newline at end of file