Skip to content

Commit

Permalink
Merge pull request #93 from Nokkvi/refactor-redundant-comments
Browse files Browse the repository at this point in the history
Removed Some Redundant Comments
  • Loading branch information
William-McGonagle committed Jan 1, 2022
2 parents d831ac3 + 97267c6 commit 0debf80
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/library/VulgarTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,17 @@ function getVulgarWords() {
}

function TokenizeString(input) {
// Make it Lowercase
const lowercase = input.toLowerCase();

// Switch Around Similar Looking Symbols
let partsRemoved = lowercase;
partsRemoved = partsRemoved.replace(/\$/g, "s");
partsRemoved = partsRemoved.replace(/@/g, "a");

// Return the Final Result
return partsRemoved;
}

function DetectVulgarWords(input) {
// Tokenize the Input String
const tokenizedString = TokenizeString(input);
const vulgarWords = getVulgarWords();

Expand All @@ -30,7 +27,6 @@ function DetectVulgarWords(input) {
if (tokenizedString.includes(word)) return true;
}

// Return False if Nothing Detected
return false;
}

Expand Down
5 changes: 0 additions & 5 deletions src/library/validator.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
// Check if Undefined
function propertyUndefined(property)
{
if (!property) return true;
return false;
}

// Check if Object is Null
function objectIsNull(obj)
{
if (!obj) return true;
Expand All @@ -16,7 +14,6 @@ function checkIfNumberInRange(num, min, max) {
return num >= min && num <= max;
}

// Check if Valid Password
function invalidPassword(password) {
if (password.length > 14) return true;
if (password.length < 4) return true;
Expand All @@ -27,7 +24,6 @@ function invalidPassword(password) {
return false;
}

// Check if Valid Username
function invalidUsername(username) {
if (username.length > 30) return true;
if (username.length < 4) return true;
Expand All @@ -38,7 +34,6 @@ function invalidUsername(username) {
return false;
}

// Check if Valid Email
function invalidEmail(email) {
return !(/^[^\s@]+@[^\s@][^\s.@]*\.[^\s@]+$/.test(email));
}
Expand Down
3 changes: 0 additions & 3 deletions src/routes/Duck/duckGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function getItemString(type, number) {
const itemData = fs.readFileSync(itemPath, "ascii");
const strippedData = stripSVGData(itemData);

// Break Each Line
return strippedData.split("\n");
}

Expand All @@ -55,7 +54,6 @@ function generateDuck(duckData) {
beakColor: colors[duckData.beakColor] || colors[5],
};

// Create the Base Data
const output = [];

// Add the Body (Spread it First)
Expand Down Expand Up @@ -88,7 +86,6 @@ function generateDuck(duckData) {
outputText = outputText.replace(/DUCK_COLOR/g, trueDuckData.color);
outputText = outputText.replace(/BEAK_COLOR/g, trueDuckData.beakColor);

// Return the Output Text
return outputText;
}

Expand Down
2 changes: 0 additions & 2 deletions src/routes/Duck/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ module.exports = (req, res) => {
const duckData = getData(req.params.id);
if (!duckData) return res.status(400).send("Bad Request.");

// Set the Headers
res.set("Content-Type", "image/svg+xml");

// Send the Duck
return res.send(
duckGenerator.formatSVG(duckGenerator.generateDuck(duckData)),
);
Expand Down
1 change: 0 additions & 1 deletion src/routes/Duck/idZoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = (req, res) => {
const zoomInt = parseInt(req.params.zoom);
res.set("Content-Type", "image/svg+xml");

// Send the Duck
res.send(
duckGenerator.formatSVG(duckGenerator.generateDuck(duckData), zoomInt),
);
Expand Down
1 change: 0 additions & 1 deletion src/routes/Joke/id.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ const { propertyUndefined } = require("../../library/validator");
module.exports = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");

// Check for ID
if (propertyUndefined(req.params.id)) return res.status(400).send("ID Not Given.");

const numID = parseInt(req.params.id, 10);
Expand Down
2 changes: 0 additions & 2 deletions src/routes/User/Account/setPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,11 @@ module.exports = (req, res) => {
return res.status(500).send("Internal Server Error.");
}

// Update Password
userData
.update(
{ password: hashString },
)
.then((newUserData) => {
// Save the Data
newUserData
.save()
.then(() => res.status(200).send("Success."))
Expand Down

0 comments on commit 0debf80

Please sign in to comment.