diff --git a/scripts/raw-api.js b/scripts/raw-api.js index 1731d9a..ec910b4 100644 --- a/scripts/raw-api.js +++ b/scripts/raw-api.js @@ -6,10 +6,10 @@ const directoryPath = path.join(__dirname, "../domains"); let combinedArray = []; fs.readdir(directoryPath, function (err, files) { - if(err) throw err; + if (err) throw err; function removeValue(value, index, arr) { - if(value === "reserved") { + if (value === "reserved") { arr.splice(index, 1); return true; } @@ -23,21 +23,21 @@ fs.readdir(directoryPath, function (err, files) { const filePath = path.join(directoryPath, file); fs.readFile(filePath, "utf8", (err, data) => { - if(err) throw err; + if (err) throw err; const dataArray = [JSON.parse(data)]; - for(const item of dataArray) { + for (const item of dataArray) { item.owner.email = item.owner.email.replace(/@/, " (at) "); } combinedArray = combinedArray.concat(dataArray); - if(combinedArray.length === files.length) { + if (combinedArray.length === files.length) { fs.writeFile("raw-api/index.json", JSON.stringify(combinedArray), (err) => { - if(err) throw err; - }) + if (err) throw err; + }); } - }) - }) -}) + }); + }); +});