From 8808f1b60d6c3c8e912a17419f1111cf4d6ce70b Mon Sep 17 00:00:00 2001 From: William Harrison Date: Thu, 29 Dec 2022 18:07:12 +0800 Subject: [PATCH] prettier --- utils/utils.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/utils/utils.js b/utils/utils.js index f9a6879..319aa50 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -3,19 +3,19 @@ const fs = require('fs'); const core = require('@actions/core'); function getFiles(path) { - //get all files in path, returns arr + // Get all files in path: returns array const allFiles = fs.readdirSync(path); return allFiles } function getFileExtension(filename) { - //get file ext + // Get file extension return (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename) : undefined; } function stripExt(filename) { - //remove file ext + // Remove file extension return filename.substr(0, filename.lastIndexOf('.')) } @@ -34,17 +34,20 @@ function checkIfValidFQDN(str) { } function checkInvalidDomain(str) { - //check invalid domains + // Check invalid domains if (invalidDomains.includes(str)) { - core.setOutput("recordInfo", "This subdomain has been blocked for register by the is-a-good.dev team.") + core.setOutput("recordInfo", "This subdomain has been blocked.") return true; } - //check reserved domains + + // Check reserved domains const files = getFiles("./reserved/").map(file => stripExt(file)); + if (files.includes(str)) { core.setOutput("recordInfo", "This subdomain has been reserved by the is-a-good.dev team.") return true; } + return false; }