| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 601f7a2 commit ba1f982
31 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,6 +22,7 @@ | |||
| 22 | 22 | ], | |
| 23 | 23 | "no-console": "error", | |
| 24 | 24 | "no-continue": "error", | |
| 25 | + "no-control-regex": 0, | ||
| 25 | 26 | "no-else-return": "error", | |
| 26 | 27 | "no-empty": "error", | |
| 27 | 28 | "no-invalid-this": "error", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,2 @@ | |||
| 1 | - api/language.ts | ||
| 2 | 1 | js | |
| 3 | 2 | node_modules | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + node_modules | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | /*global global*/ | |
| 2 | 2 | (function options_init(): void { | |
| 3 | 3 | "use strict"; | |
| 4 | - const optionDef = { | ||
| 4 | + const optionDef:optionDef = { | ||
| 5 | 5 | brace_line : { | |
| 6 | 6 | api : "any", | |
| 7 | 7 | default : false, | |
@@ -32,9 +32,9 @@ | |||
| 32 | 32 | mode : "beautify", | |
| 33 | 33 | type : "string", | |
| 34 | 34 | values : { | |
| 35 | - "collapse" : "Sets options.formatObject to 'indent' and options.neverflatten to true.", | ||
| 36 | - "collapse-preserve-inline": "Sets options.bracepadding to true and options.formatObject to 'inline'.", | ||
| 37 | - "expand" : "Sets options.braces to true, options.formatObject to 'indent', and options.never" + | ||
| 35 | + "collapse" : "Sets options.format_object to 'indent' and options.neverflatten to true.", | ||
| 36 | + "collapse-preserve-inline": "Sets options.bracepadding to true and options.format_object to 'inline'.", | ||
| 37 | + "expand" : "Sets options.braces to true, options.format_object to 'indent', and options.never" + | ||
| 38 | 38 | "flatten to true.", | |
| 39 | 39 | "none" : "Ignores this option" | |
| 40 | 40 | } | |
@@ -98,7 +98,7 @@ | |||
| 98 | 98 | definition: "If CSS should be beautified in a style where the properties and values are minif" + | |
| 99 | 99 | "ed for faster reading of selectors.", | |
| 100 | 100 | label : "Compressed CSS", | |
| 101 | - lexer : "css", | ||
| 101 | + lexer : "style", | ||
| 102 | 102 | mode : "beautify", | |
| 103 | 103 | type : "boolean" | |
| 104 | 104 | }, | |
@@ -146,7 +146,7 @@ | |||
| 146 | 146 | default : false, | |
| 147 | 147 | definition: "Inserts new line characters between every CSS code block.", | |
| 148 | 148 | label : "Insert Empty Lines", | |
| 149 | - lexer : "css", | ||
| 149 | + lexer : "style", | ||
| 150 | 150 | mode : "beautify", | |
| 151 | 151 | type : "boolean" | |
| 152 | 152 | }, | |
@@ -486,7 +486,7 @@ | |||
| 486 | 486 | lexer : "any", | |
| 487 | 487 | mode : "any", | |
| 488 | 488 | type : "string", | |
| 489 | - values : { // analysis: "returns a code examination report", | ||
| 489 | + values : { | ||
| 490 | 490 | beautify: "beautifies code and returns a string", | |
| 491 | 491 | diff : "returns either command line list of differences or an HTML report", | |
| 492 | 492 | minify : "minifies code and returns a string", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | (function beautify_markup_init():void { | |
| 3 | 3 | "use strict"; | |
| 4 | 4 | const markup = function beautify_markup(options:any):string { | |
| 5 | - const data:parsedArray = options.parsed, | ||
| 5 | + const data:data = options.parsed, | ||
| 6 | 6 | lexer:string = "markup", | |
| 7 | 7 | c:number = (options.end < 1 || options.end > data.token.length) | |
| 8 | 8 | ? data.token.length | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | const script = function beautify_script(options:any):string { | |
| 5 | 5 | let scolon:number = 0, | |
| 6 | 6 | news:number = 0; | |
| 7 | - const data:parsedArray = options.parsed, | ||
| 7 | + const data:data = options.parsed, | ||
| 8 | 8 | lexer:string = "script", | |
| 9 | 9 | scopes:scriptScopes = prettydiff.scopes, | |
| 10 | 10 | b:number = (options.end < 1 || options.end > data.token.length) | |
@@ -93,9 +93,9 @@ | |||
| 93 | 93 | if (a < b - 1 && data.stack[aa] !== "block" && (data.token[aa] === "{" || data.token[aa] === "x{")) { | |
| 94 | 94 | let bb:number = scopes.length; | |
| 95 | 95 | data.begin.splice(a, 0, data.begin[aa]); | |
| 96 | + data.ender.splice(a, 0, data.ender[aa]); | ||
| 96 | 97 | data.lexer.splice(a, 0, data.lexer[aa]); | |
| 97 | 98 | data.lines.splice(a, 0, data.lines[aa]); | |
| 98 | - data.presv.splice(a, 0, data.presv[aa]); | ||
| 99 | 99 | data.stack.splice(a, 0, data.stack[aa]); | |
| 100 | 100 | data.token.splice(a, 0, data.token[aa]); | |
| 101 | 101 | data.types.splice(a, 0, data.types[aa]); | |
@@ -111,9 +111,9 @@ | |||
| 111 | 111 | } | |
| 112 | 112 | aa = aa + 1; | |
| 113 | 113 | data.begin.splice(aa, 1); | |
| 114 | + data.ender.splice(aa, 1); | ||
| 114 | 115 | data.lexer.splice(aa, 1); | |
| 115 | 116 | data.lines.splice(aa, 1); | |
| 116 | - data.presv.splice(aa, 1); | ||
| 117 | 117 | data.stack.splice(aa, 1); | |
| 118 | 118 | data.token.splice(aa, 1); | |
| 119 | 119 | data.types.splice(aa, 1); | |
@@ -300,7 +300,7 @@ | |||
| 300 | 300 | destructfix(true, false); | |
| 301 | 301 | } | |
| 302 | 302 | if (data.stack[a] !== "attribute") { | |
| 303 | - if (ctoke !== ")" && ctoke !== "x)" && (ltype !== "markup" || (ltype === "markup" && data.token[a - 2] !== "return"))) { | ||
| 303 | + if (ctoke !== ")" && ctoke !== "x)" && (data.lexer[a - 1] !== "markup" || (data.lexer[a - 1] === "markup" && data.token[a - 2] !== "return"))) { | ||
| 304 | 304 | indent = indent - 1; | |
| 305 | 305 | } | |
| 306 | 306 | if (ctoke === "}" && data.stack[a] === "switch" && options.no_case_indent === false) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | (function beautify_style_init():void { | |
| 3 | 3 | "use strict"; | |
| 4 | 4 | const style = function beautify_style(options:any):string { | |
| 5 | - const data:parsedArray = options.parsed, | ||
| 5 | + const data:data = options.parsed, | ||
| 6 | 6 | lf:"\r\n"|"\n" = (options.crlf === true) | |
| 7 | 7 | ? "\r\n" | |
| 8 | 8 | : "\n", | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,15 +4,15 @@ declare var prettydiff: any; | |||
| 4 | 4 | declare var window: Window; | |
| 5 | 5 | declare module NodeJS { | |
| 6 | 6 | interface Global { | |
| 7 | - parseFramework: any; | ||
| 7 | + sparser: any; | ||
| 8 | 8 | prettydiff: any | |
| 9 | 9 | } | |
| 10 | 10 | } | |
| 11 | 11 | type api = "any" | "dom" | "node"; | |
| 12 | 12 | type codes = [string, number, number, number, number]; | |
| 13 | 13 | type languageAuto = [string, string, string]; | |
| 14 | - type lexer = "markup" | "script" | "style"; | ||
| 15 | - type mode = "analysis" | "beautify" | "diff" | "minify" | "parse"; | ||
| 14 | + type lexer = "any" | "markup" | "script" | "style"; | ||
| 15 | + type mode = "beautify" | "diff" | "minify" | "parse"; | ||
| 16 | 16 | type qualifier = "begins" | "contains" | "ends" | "file begins" | "file contains" | "file ends" | "file is" | "file not" | "file not contains" | "filesystem contains" | "filesystem not contains" | "is" | "not" | "not contains"; | |
| 17 | 17 | interface commandList { | |
| 18 | 18 | [key: string]: { | |
@@ -26,6 +26,15 @@ interface commandList { | |||
| 26 | 26 | interface compareStore extends Array<[number, number]>{ | |
| 27 | 27 | [index:number]: [number, number]; | |
| 28 | 28 | } | |
| 29 | + interface data { | ||
| 30 | + begin: number[]; | ||
| 31 | + ender: number[]; | ||
| 32 | + lexer: string[]; | ||
| 33 | + lines: number[]; | ||
| 34 | + stack: string[]; | ||
| 35 | + token: string[]; | ||
| 36 | + types: string[]; | ||
| 37 | + } | ||
| 29 | 38 | interface diffJSON extends Array<["+"|"-"|"=", string]|["r", string, string]> { | |
| 30 | 39 | [index:number]: ["+"|"-"|"=", string]|["r", string, string]; | |
| 31 | 40 | } | |
@@ -40,6 +49,9 @@ interface diffStatus { | |||
| 40 | 49 | interface difftable { | |
| 41 | 50 | [key: string]: [number, number]; | |
| 42 | 51 | } | |
| 52 | + interface diffview { | ||
| 53 | + (): [string, number, number] | ||
| 54 | + } | ||
| 43 | 55 | interface dom { | |
| 44 | 56 | [key: string]: any; | |
| 45 | 57 | } | |
@@ -51,9 +63,6 @@ interface domMethods { | |||
| 51 | 63 | [key: string]: any; | |
| 52 | 64 | }; | |
| 53 | 65 | } | |
| 54 | - interface diffview { | ||
| 55 | - (): [string, number, number] | ||
| 56 | - } | ||
| 57 | 66 | interface externalIndex { | |
| 58 | 67 | [key: string]: number; | |
| 59 | 68 | } | |
@@ -124,6 +133,7 @@ interface nodeLists { | |||
| 124 | 133 | heading: string; | |
| 125 | 134 | obj: any; | |
| 126 | 135 | property: "eachkey" | string; | |
| 136 | + total: boolean; | ||
| 127 | 137 | } | |
| 128 | 138 | interface opcodes extends Array<codes> { | |
| 129 | 139 | [index: number]: codes; | |
@@ -134,7 +144,7 @@ interface option { | |||
| 134 | 144 | definition: string; | |
| 135 | 145 | label: string; | |
| 136 | 146 | lexer: lexer; | |
| 137 | - mode: mode; | ||
| 147 | + mode: "any" | mode; | ||
| 138 | 148 | type: "boolean" | "number" | "string"; | |
| 139 | 149 | values?: { | |
| 140 | 150 | [key: string]: string; | |
@@ -147,28 +157,6 @@ interface optionFunctions { | |||
| 147 | 157 | definitions?: {}; | |
| 148 | 158 | ||
| 149 | 159 | } | |
| 150 | - interface parsedArray { | ||
| 151 | - begin: number[]; | ||
| 152 | - lexer: string[]; | ||
| 153 | - lines: number[]; | ||
| 154 | - presv: boolean[]; | ||
| 155 | - stack: string[]; | ||
| 156 | - token: string[]; | ||
| 157 | - types: string[]; | ||
| 158 | - } | ||
| 159 | - interface parsedObject { | ||
| 160 | - [index: number]: record; | ||
| 161 | - } | ||
| 162 | - interface parseOptions { | ||
| 163 | - lexer: "string"; | ||
| 164 | - lexerOptions: { | ||
| 165 | - [key: string]: { | ||
| 166 | - [key: string]: any; | ||
| 167 | - } | ||
| 168 | - }; | ||
| 169 | - outputFormat: "objects" | "arrays"; | ||
| 170 | - source: "string"; | ||
| 171 | - } | ||
| 172 | 160 | interface performance { | |
| 173 | 161 | codeLength: number; | |
| 174 | 162 | diff: string; | |
@@ -188,9 +176,9 @@ interface readDirectory { | |||
| 188 | 176 | } | |
| 189 | 177 | interface record { | |
| 190 | 178 | begin: number; | |
| 179 | + ender: number; | ||
| 191 | 180 | lexer: string; | |
| 192 | 181 | lines: number; | |
| 193 | - presv: boolean; | ||
| 194 | 182 | stack: string; | |
| 195 | 183 | token: string; | |
| 196 | 184 | types: string; | |
@@ -206,5 +194,5 @@ interface simulationItem { | |||
| 206 | 194 | test: string; | |
| 207 | 195 | } | |
| 208 | 196 | interface Window { | |
| 209 | - parseFramework: any; | ||
| 197 | + sparser: any; | ||
| 210 | 198 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments