Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Some Redundant Comments #93

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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