mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-10-12 22:14:49 +00:00
Update raw-api.js
This commit is contained in:
1 parent
5c45af8ae1
commit
568e506377
1 file changed
+9
-7
+9
-7
@@ -80,21 +80,21 @@ fs.readdir(directoryPath, function (err, files) {
|
||||
item.domain = name + ".is-a.dev";
|
||||
item.subdomain = name;
|
||||
|
||||
if (item.owner && item.owner.email) {
|
||||
delete item.owner.email;
|
||||
}
|
||||
delete item.owner.email;
|
||||
|
||||
const itemV1 = {
|
||||
...item,
|
||||
domain: item.domain,
|
||||
subdomain: item.subdomain,
|
||||
owner: item.owner,
|
||||
record: item.records
|
||||
};
|
||||
delete itemV1.records;
|
||||
|
||||
const itemV2 = {
|
||||
...item,
|
||||
domain: item.domain,
|
||||
subdomain: item.subdomain,
|
||||
owner: item.owner,
|
||||
records: item.records
|
||||
};
|
||||
delete itemV2.record;
|
||||
|
||||
v1.push(itemV1);
|
||||
v2.push(itemV2);
|
||||
@@ -112,6 +112,8 @@ fs.readdir(directoryPath, function (err, files) {
|
||||
fs.writeFile("raw-api/v2.json", JSON.stringify(v2, null, 2), (err) => {
|
||||
if (err) throw err;
|
||||
});
|
||||
} else {
|
||||
throw new Error("processedCount is not equal to files.length");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user