jetc 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function z(...a){a=a.join("/").split("/");let b=a.length;for(let c=1;c<b;c++)0<c&&c<b-1&&!a[c]?(a.splice(c,1),--b,--c):0<c&&"."===a[c]?(a.splice(c,1),--b,--c):1===c&&".."===a[c]&&"."===a[c-1]?(a.splice(c-1,1),--b,--c):0<c&&".."===a[c]&&"."!==a[c-1]&&".."!==a[c-1]&&(a.splice(c-1,2),b-=2,c-=2);return a.join("/")}function A(a,b){try{return require.resolve(a,b).replace(/\\/g,"/")}catch(c){}return null}function B(a){return 0<a.a.length&&""===a.a[0]}
|
|
3
3
|
class C{constructor(a){this.path=a;this.a=this.path.split("/");this.filename=this.a.pop();this.folder=this.a.join("/");this.ext=this.name=null;a=this.filename.split(".");this.ext=1<a.length&&(a[0]||2<a.length)?a.pop():"";this.name=a.join(".")}mimeType(){return{css:"text/css",htm:"text/html",html:"text/html",js:"application/javascript",json:"application/json",scss:"text/scss",txt:"text/plain",xml:"text/xml"}[this.ext]||""}toString(){return this.path}}
|
|
4
4
|
function D(a,b,c){({name:b}=new C(b));a=y(a,b,"css");b=z(".",a);c.name=b;return{href:a,filename:b}}function E(a){return a&&"'jet module';"===a.slice(0,13)}function F(a){return"application/javascript"===a}var G={"single-comment":"slash slash *!end-line end-line","multi-comment":"slash star *!(star slash) star slash",comment:"single-comment | multi-comment"},H={"single-string":"single-quote *((escape any) | !single-quote) single-quote"},I={"double-string":"double-quote *((escape any) | !double-quote) double-quote"};
|
|
5
|
-
const J={...G,...H,...I,string:"single-string | double-string",bracket:"lbrace | rbrace | lparen | rparen | lbracket | rbracket","base-symbol":"+symbol","extended-symbol":"symbol | punctuation | bracket",delimiter:"comment | string | extended-symbol",compress:"*space +delimiter *space",grammar:"*(compress | any)"},K={...J,"base-symbol":": | ="},L={comment:"less exclamation dash dash *!(dash dash more) dash dash more",...H,...I,"attribute-name":"letter *(letter | digit | dash)","attribute-value":"single-string | double-string",
|
|
5
|
+
const J={...G,...H,...I,string:"single-string | double-string",bracket:"lbrace | rbrace | lparen | rparen | lbracket | rbracket","base-symbol":"+symbol","extended-symbol":"base-symbol | punctuation | bracket",delimiter:"comment | string | extended-symbol",compress:"*space +delimiter *space",grammar:"*(compress | any)"},K={...J,"base-symbol":": | ="},L={comment:"less exclamation dash dash *!(dash dash more) dash dash more",...H,...I,"attribute-name":"letter *(letter | digit | dash)","attribute-value":"single-string | double-string",
|
|
6
6
|
attribute:"attribute-name ?(equal attribute-value)","tag-name":"letter *(letter | digit | dash)","tag-body":"*(space | attribute)","any-tag":"less ?slash tag-name tag-body more",head:"(H | h) (E | e) (A | a) (D | d)",script:"(S | s) (C | c) (R | r) (I | i) (P | p) (T | t)","start-head":"less head tag-body more","end-head":"less slash head more","content-head":"*(tag-script | !end-head)","start-script":"less script tag-body more","end-script":"less slash script more","content-script":"*!end-script",
|
|
7
7
|
"tag-head":"start-head content-head end-head","tag-script":"start-script content-script end-script",tag:"tag-head | tag-script | any-tag",grammar:"*(tag | comment | any)"},M={...G,...H,...I,"back-string":"back-quote *((escape any) | (dollar context) | !back-quote) back-quote",string:"single-string | double-string | back-string",context:"lbrace *(code | !rbrace) rbrace","import-source":"single-string | double-string","module-require":"require *space lparen import-source rparen",code:"module-require | comment | string | context",
|
|
8
8
|
grammar:"*(code | any)"},P={comment:N,compress:O,delimiter:null},S={attribute:null,"content-head":null,"content-script":null,"end-head":null,"start-head":null,"tag-head":Q,"tag-script":R},U={"import-source":null,"module-require":T};function N(a){return[a,""]}function O(a,b){const c=b.length;let d="";for(let e=0;e<c;e+=2){const f=b[e+1];"space"!==b[e]&&(d+=f)}return[a,d]}
|