Skip to content

Commit

Permalink
refactor: remove extra comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Sep 23, 2024
1 parent 8b1ce02 commit b3b8899
Show file tree
Hide file tree
Showing 10 changed files with 8 additions and 68 deletions.
3 changes: 2 additions & 1 deletion src/app/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { Parameters } from '#shared';
/**
* Handles an error.
*
* @param {string} message - The error message.
* @param {string|array} message - The error message,
* @prop {''} or @prop {['', { length: number }]}.
*
* @param {boolean} [hasTime=true] - Indicates if the error has a timestamp.
*
Expand Down
3 changes: 2 additions & 1 deletion src/app/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { Parameters } from '#shared';
/**
* Handles an info.
*
* @param {string} message - The info message.
* @param {string|array} message - The info message,
* @prop {''} or @prop {['', { length: number }]}.
*
* @param {boolean} [hasTime=true] - Indicates if the info has a timestamp.
*
Expand Down
3 changes: 2 additions & 1 deletion src/app/success.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { Parameters } from '#shared';
/**
* Handles an success.
*
* @param {string} message - The success message.
* @param {string|array} message - The success message,
* @prop {''} or @prop {['', { length: number }]}.
*
* @param {boolean} [hasTime=true] - Indicates if the success has a timestamp.
*
Expand Down
3 changes: 2 additions & 1 deletion src/app/warning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import type { Parameters } from '#shared';
/**
* Handles an warning.
*
* @param {string} message - The warning message.
* @param {string|array} message - The warning message,
* @prop {''} or @prop {['', { length: number }]}.
*
* @param {boolean} [hasTime=true] - Indicates if the warning has a timestamp.
*
Expand Down
12 changes: 0 additions & 12 deletions src/features/generators/notification/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,6 @@ import { currentTime, truncate } from '#helpers';

import type { Parameters } from './parameters.ts';

/**
* Generates a notification message.
*
* @param {string} message - The main message content of the notification.
*
* @param {string} title - The title of the notification.
*
* @param {boolean} hasTime - Indicates if the notification includes a timestamp.
*
* @return {string} - The formatted notification message with optional
* timestamp, title, and optional truncated body.
*/
const notificationGenerator = async (parameters: Parameters) => {
const { message, title, hasTime } = parameters;

Expand Down
1 change: 0 additions & 1 deletion src/features/helpers/current-time.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @return time as a string in the format of HH:MM:SS. */
const currentTime = async () => new Date().toLocaleTimeString();

export { currentTime };
10 changes: 0 additions & 10 deletions src/features/helpers/truncate/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import type { Parameters } from './parameters.ts';

/**
* Truncates a string or array message based on the specified length.
*
* @param {string | Array} message - The message to be truncated.
*
* @param {number} [length=Infinity] - The message to be truncated.
*
* @return {string} - The truncated message if it's length exceeds
* the specified length, otherwise the original message.
*/
const truncate = async (parameters: Parameters) => {
const { message } = parameters;

Expand Down
13 changes: 0 additions & 13 deletions src/features/log-level/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,6 @@ import { notificationGenerator } from '#generators';

import type { Parameters } from './parameters.ts';

/**
* Logs a message with a specified log level.
*
* @param {string} message - The message to be logged.
*
* @param {string} title - The log level of the message.
*
* @param {boolean} hasTime - Indicates if the log should
* include a timestamp.
*
* @return {void} - Logs the message with the specified log level
* using console methods.
*/
const logLevel = async (parameters: Parameters) => {
const { message, title, hasTime } = parameters;

Expand Down
11 changes: 0 additions & 11 deletions src/features/notifier/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,6 @@ import { truncate } from '#helpers';

import type { Parameters } from './parameters.ts';

/**
* Notifies.
*
* @param {string} icon - The icon for the notification.
*
* @param {string} message - The message content of the notification.
*
* @param {string} title - The title of the notification.
*
* @return {Promise} - A promise that resolves to the notification result.
*/
const notifier = async (parameters: Parameters) => {
const { icon, message, title } = parameters;

Expand Down
17 changes: 0 additions & 17 deletions src/features/splitter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,6 @@ import { notifier } from '../notifier/index.ts';

import type { Parameters } from './parameters.ts';

/**
* Splits the notification based on the notification mode
* and performs the corresponding action.
*
* @param {string} icon - The icon for the notification.
*
* @param {string} title - The title of the notification.
*
* @param {string} message - The message content of the notification.
*
* @param {boolean} hasTime - Indicates if the notification includes a timestamp.
*
* @param {string} notificationMode - The mode of notification
* ('console', 'desktop' or 'multiple').
*
* @returns {Object|Array} - The result of the notification action based on the mode.
*/
const splitter = async (parameters: Parameters) => {
const { icon, title, message, hasTime, notificationMode } = parameters;

Expand Down

0 comments on commit b3b8899

Please sign in to comment.