(file:string, fileFlag:string)
| 1027 | optkeys:string[] = Object.keys(prettydiff.api.optionDef), |
| 1028 | keyslen:number = optkeys.length, |
| 1029 | modifyFile = function node_apps_build_libraries_modifyFile(file:string, fileFlag:string):void { |
| 1030 | node.fs.readFile(file, "utf8", function node_apps_build_libraries_modifyFile_read(err:Error, data:string):void { |
| 1031 | const modify = function node_apps_build_libraries_modifyFile_read_modify(ops:modifyOps):void { |
| 1032 | const start:number = (function node_apps_build_libraries_modifyFile_read_modify_startBuild():number { |
| 1033 | const len = (ops.start.indexOf("//") === 0) |
| 1034 | ? (function node_apps_build_libraries_modifyFile_read_modify_startBuild_lineStart():number { |
| 1035 | data = data.replace(new RegExp(ops.start + "\\s+"), ops.start + "\n"); |
| 1036 | return ops.start.length + 1; |
| 1037 | }()) |
| 1038 | : ops.start.length; |
| 1039 | return data.indexOf(ops.start) + len; |
| 1040 | }()), |
| 1041 | end:number = data.indexOf(ops.end); |
| 1042 | if (start < 0) { |
| 1043 | apps.errout([ |
| 1044 | "The injection start is missing from the file:", |
| 1045 | `Injection start: ${ops.start}`, |
| 1046 | `File flag: ${fileFlag}` |
| 1047 | ]); |
| 1048 | return; |
| 1049 | } |
| 1050 | if (end < start) { |
| 1051 | apps.errout([ |
| 1052 | "The injection end is missing from the file:", |
| 1053 | `Injection end: ${ops.end}`, |
| 1054 | `File flag: ${fileFlag}` |
| 1055 | ]); |
| 1056 | return; |
| 1057 | } |
| 1058 | if (ops.end.indexOf("//") === 0) { |
| 1059 | data = data.replace(new RegExp(ops.end + "\\s+"), ops.end + "\n"); |
| 1060 | } |
| 1061 | data = [data.slice(0, start), ops.injectFlag + "\n", data.slice(end)].join(""); |
| 1062 | }, |
| 1063 | buildDocumentation = function node_apps_build_libraries_modifyFile_read_buildDocumentation():string { |
| 1064 | const allOptions:string[] = []; |
| 1065 | let a:number = 0, |
| 1066 | b:number = 0, |
| 1067 | vals:string[], |
| 1068 | vallen:number, |
| 1069 | item:string[], |
| 1070 | optName:string, |
| 1071 | opt:option; |
| 1072 | do { |
| 1073 | optName = optkeys[a]; |
| 1074 | opt = prettydiff.api.optionDef[optName]; |
| 1075 | item = [`<li id="${optName}">`]; |
| 1076 | item.push(`<h4>${optName}</h4>`); |
| 1077 | item.push(`<ul><li><h5>Description</h5>`); |
| 1078 | item.push(opt.definition); |
| 1079 | item.push(`</li><li><h5>Environment</h5>`); |
| 1080 | item.push(opt.api); |
| 1081 | item.push(`</li><li><h5>Type</h5>`); |
| 1082 | item.push(opt.type); |
| 1083 | item.push(`</li><li><h5>Mode</h5>`); |
| 1084 | item.push(opt.mode); |
| 1085 | item.push(`</li><li><h5>Lexer</h5>`); |
| 1086 | item.push(opt.lexer); |
no test coverage detected