Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
chore: fix inline comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed May 27, 2023
1 parent 04038b3 commit 89e1492
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/license-checker.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async function checkLicenses() {
"LGPL-3.0+",
];

// merge copyleft licenses with deprecated licenses list
// Merge copyleft licenses with deprecated licenses list
copyLeftLicenses.push(...deprecatedLicenseList);

const licenses = await init({
Expand Down
6 changes: 3 additions & 3 deletions src/plugins/clean-object/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ const fp = require("fastify-plugin");
/**
* @author Frazer Smith
* @author Felix Meyer-Wolters
* @description Removes key value pairs from an object where the value is null or undefined.
* Adapted from Felix's answer at https://stackoverflow.com/a/38340730
* @description Recursively removes key value pairs from an object where the value is null
* or undefined. Adapted from Felix's answer at https://stackoverflow.com/a/38340730
* @param {object=} object - Object to be parsed and cleaned.
* @returns {object} cleaned object.
*/
function cleanObject(object = {}) {
const obj = object;
Object.keys(obj).forEach((key) => {
if (obj[key] && typeof obj[key] === "object") {
cleanObject(obj[key]); // recursive
cleanObject(obj[key]);
} else if (obj[key] === null || obj[key] === undefined) {
delete obj[key];
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/clean-object/plugin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ describe("Clean-Object plugin", () => {
await server.close();
});

it("Removes keys from request object where value is undefined or null", async () => {
it("Recursively removes keys from request object where value is undefined or null", async () => {
const response = await server.inject({
method: "PUT",
url: "/",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/escape-single-quotes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* in string expressions with two adjacent single quotes, which allows
* a single-quote character within a string constant in SQL.
* @param {*} strings
* @param {...any} expressions
* @param {...*} expressions
* @returns {string} Template literal with single-quote characters replaced
* with two adjacent single quotes in expressions.
*/
Expand Down

0 comments on commit 89e1492

Please sign in to comment.