| 4449 | return; |
| 4450 | } |
| 4451 | const pusher = function node_apps_validation_readDir_reading_pusher(value:string, index:number, arr:string[]) { |
| 4452 | node.fs.readFile(dir + sep + value, "utf8", function node_apps_validation_readDir_reading_pusher_readFile(er:Error, fileData:string) { |
| 4453 | if (er !== null) { |
| 4454 | apps.errout([er.toString()]); |
| 4455 | return; |
| 4456 | } |
| 4457 | if (type === "raw") { |
| 4458 | raw.push([value, fileData]); |
| 4459 | count_raw = count_raw + 1; |
| 4460 | if (count_raw === arr.length) { |
| 4461 | flag.raw = true; |
| 4462 | if (flag.formatted === true) { |
| 4463 | compare(); |
| 4464 | } |
| 4465 | } |
| 4466 | } else if (type === "formatted") { |
| 4467 | formatted.push([value, fileData]); |
| 4468 | count_formatted = count_formatted + 1; |
| 4469 | if (count_formatted === arr.length) { |
| 4470 | flag.formatted = true; |
| 4471 | if (flag.raw === true) { |
| 4472 | compare(); |
| 4473 | } |
| 4474 | } |
| 4475 | } |
| 4476 | }); |
| 4477 | }; |
| 4478 | list.forEach(pusher); |
| 4479 | }); |
| 4480 | }; |