From 2d67b7c181983b7a75756fd7164f53476a0e59f3 Mon Sep 17 00:00:00 2001 From: Matthew Herod Date: Fri, 3 Jan 2025 12:40:21 +0000 Subject: [PATCH] style: fix JSDoc formatting across codebase --- scripts/readGithubCookies.ts | 17 ++++++++++++----- src/cli/cliQueryCookies.ts | 1 - .../browsers/CompositeCookieQueryStrategy.ts | 2 -- src/core/browsers/CookieStoreQueryStrategy.ts | 2 -- .../chrome/ChromeApplicationSupport.ts | 1 - .../chrome/ChromeCookieQueryStrategy.ts | 2 -- .../__tests__/fixtures/cookieFixtures.ts | 3 --- src/core/browsers/chrome/testSetup.ts | 1 - .../firefox/FirefoxCookieQueryStrategy.ts | 3 --- src/core/browsers/getEncryptedChromeCookie.ts | 5 ----- src/core/browsers/listChromeProfiles.ts | 18 ++++++------------ .../browsers/mock/MockCookieQueryStrategy.ts | 13 ++----------- src/core/cookies/CookieStore.ts | 2 -- src/core/cookies/SpecialCases.ts | 1 - src/core/cookies/comboQueryCookieSpec.ts | 10 ++-------- src/core/cookies/index.d.ts | 10 ---------- src/core/cookies/resultsRendered.ts | 3 --- src/paths.ts | 3 --- src/tests/CookieSpec.ts | 2 -- .../browsers/mock/MockCookieQueryStrategy.ts | 3 --- src/tests/getMergedRenderedCookies.ts | 2 -- src/tests/readGithubCookies.ts | 1 - src/types/BrowserName.ts | 1 - src/types/CookieQueryStrategy.ts | 2 -- src/types/CookieRow.ts | 2 -- src/types/CookieSchema.ts | 4 ---- src/types/ZodUtils.ts | 5 ----- src/utils/__mocks__/logger.ts | 1 - src/utils/findAllFiles.ts | 16 ++++++---------- src/utils/logger.ts | 1 - 30 files changed, 28 insertions(+), 109 deletions(-) diff --git a/scripts/readGithubCookies.ts b/scripts/readGithubCookies.ts index bb7de31..e3bc741 100644 --- a/scripts/readGithubCookies.ts +++ b/scripts/readGithubCookies.ts @@ -5,7 +5,6 @@ import logger from "../src/utils/logger"; /** * Checks if a string matches the basic JWT format - * * @param str - The string to check * @returns True if the string matches JWT format, false otherwise * @example @@ -38,10 +37,14 @@ export function isJWT(str: string): boolean { } /** - * Prints information about a single cookie - * + * Prints information about a cookie and checks if it's a JWT * @param cookie - The cookie to print information about * @returns Whether this was a JWT cookie + * @example + * ```typescript + * const cookie = { name: 'session', value: 'xyz', domain: 'github.com' }; + * const isJwt = printCookieInfo(cookie); + * ``` */ function printCookieInfo(cookie: ExportedCookie): boolean { logger.info("Name: %s", cookie.name); @@ -67,10 +70,14 @@ function printCookieInfo(cookie: ExportedCookie): boolean { } /** - * Prints a summary of the cookie search results - * + * Prints a summary of found cookies and JWT count * @param cookies - The found cookies * @param jwtCount - Number of JWT cookies found + * @example + * ```typescript + * const cookies = [{ name: 'session', value: 'xyz' }]; + * printSummary(cookies, 1); + * ``` */ function printSummary(cookies: ExportedCookie[], jwtCount: number): void { logger.info("\nSummary:"); diff --git a/src/cli/cliQueryCookies.ts b/src/cli/cliQueryCookies.ts index f18bf87..d0c5062 100644 --- a/src/cli/cliQueryCookies.ts +++ b/src/cli/cliQueryCookies.ts @@ -103,7 +103,6 @@ function handleOutput(results: ExportedCookie[], args: ParsedArgs): void { /** * Query cookies from browsers using the CLI interface - * * @param cookieSpec - Cookie specification(s) to query for * @param browsers - List of browsers to query from * @param profiles - List of browser profiles to query from diff --git a/src/core/browsers/CompositeCookieQueryStrategy.ts b/src/core/browsers/CompositeCookieQueryStrategy.ts index 9adfde1..6cb2882 100644 --- a/src/core/browsers/CompositeCookieQueryStrategy.ts +++ b/src/core/browsers/CompositeCookieQueryStrategy.ts @@ -13,7 +13,6 @@ type CookieStrategyConstructor = new () => CookieQueryStrategy; /** * A composite strategy that combines multiple cookie query strategies * This allows querying cookies from multiple browsers simultaneously - * * @example */ export class CompositeCookieQueryStrategy implements CookieQueryStrategy { @@ -37,7 +36,6 @@ export class CompositeCookieQueryStrategy implements CookieQueryStrategy { /** * Queries cookies from all registered strategies - * * @param name - The name pattern to match cookies against * @param domain - The domain pattern to match cookies against * @returns A promise that resolves to an array of exported cookies from all strategies diff --git a/src/core/browsers/CookieStoreQueryStrategy.ts b/src/core/browsers/CookieStoreQueryStrategy.ts index f6372f0..1205f14 100644 --- a/src/core/browsers/CookieStoreQueryStrategy.ts +++ b/src/core/browsers/CookieStoreQueryStrategy.ts @@ -42,7 +42,6 @@ const ToughCookieSchema = z /** * A strategy for querying cookies from an internal cookie store * This class implements the CookieQueryStrategy interface and provides access to cookies stored internally - * * @example */ export default class CookieStoreQueryStrategy implements CookieQueryStrategy { @@ -53,7 +52,6 @@ export default class CookieStoreQueryStrategy implements CookieQueryStrategy { /** * Queries cookies from the internal cookie store - * * @param name - The name of the cookie to query * @param domain - The domain to query cookies from * @returns A promise that resolves to an array of exported cookies from the internal store diff --git a/src/core/browsers/chrome/ChromeApplicationSupport.ts b/src/core/browsers/chrome/ChromeApplicationSupport.ts index 5fff18a..6e5ec95 100644 --- a/src/core/browsers/chrome/ChromeApplicationSupport.ts +++ b/src/core/browsers/chrome/ChromeApplicationSupport.ts @@ -5,7 +5,6 @@ import { HOME } from "../../../global"; /** * The path to Chrome's application support directory on macOS * This constant is used to locate Chrome's profile and cookie storage directories - * * @example */ export const chromeApplicationSupport = join( diff --git a/src/core/browsers/chrome/ChromeCookieQueryStrategy.ts b/src/core/browsers/chrome/ChromeCookieQueryStrategy.ts index 8f27387..be93d51 100644 --- a/src/core/browsers/chrome/ChromeCookieQueryStrategy.ts +++ b/src/core/browsers/chrome/ChromeCookieQueryStrategy.ts @@ -50,7 +50,6 @@ function createExportedCookie( /** * Strategy for querying cookies from Chrome browser - * * @example */ export class ChromeCookieQueryStrategy implements CookieQueryStrategy { @@ -63,7 +62,6 @@ export class ChromeCookieQueryStrategy implements CookieQueryStrategy { /** * Queries cookies from Chrome's cookie store - * * @param name - The name pattern to match cookies against * @param domain - The domain pattern to match cookies against * @returns A promise that resolves to an array of exported cookies diff --git a/src/core/browsers/chrome/__tests__/fixtures/cookieFixtures.ts b/src/core/browsers/chrome/__tests__/fixtures/cookieFixtures.ts index be8e667..46e6e9f 100644 --- a/src/core/browsers/chrome/__tests__/fixtures/cookieFixtures.ts +++ b/src/core/browsers/chrome/__tests__/fixtures/cookieFixtures.ts @@ -1,7 +1,6 @@ /** * Test password used for decryption tests * This is a real Chrome encryption password from a test environment - * * @example */ export const TEST_PASSWORD = "lQd+BkD+nBhODek1xUUxXw=="; @@ -9,7 +8,6 @@ export const TEST_PASSWORD = "lQd+BkD+nBhODek1xUUxXw=="; /** * Test cookie data with encrypted and expected decrypted values * These are real cookies from GitHub with non-sensitive values - * * @example */ export const TEST_COOKIES = { @@ -48,7 +46,6 @@ export const TEST_COOKIES = { /** * Test cases for error handling scenarios * Each case includes the input that should trigger an error and the expected error message - * * @example */ export const ERROR_CASES = [ diff --git a/src/core/browsers/chrome/testSetup.ts b/src/core/browsers/chrome/testSetup.ts index 22317c6..f63651e 100644 --- a/src/core/browsers/chrome/testSetup.ts +++ b/src/core/browsers/chrome/testSetup.ts @@ -32,7 +32,6 @@ export const mockCookieData = { /** * Sets up a Chrome test environment with mocked dependencies - * * @returns A configured ChromeCookieQueryStrategy instance */ export function setupChromeTest(): ChromeCookieQueryStrategy { diff --git a/src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts b/src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts index c210ad5..f2cd249 100644 --- a/src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts +++ b/src/core/browsers/firefox/FirefoxCookieQueryStrategy.ts @@ -18,7 +18,6 @@ interface FirefoxCookieRow { /** * Find all Firefox cookie database files - * * @returns An array of file paths to Firefox cookie databases */ function findFirefoxCookieFiles(): string[] { @@ -49,7 +48,6 @@ function findFirefoxCookieFiles(): string[] { /** * Strategy for querying cookies from Firefox browser - * * @example */ export class FirefoxCookieQueryStrategy implements CookieQueryStrategy { @@ -60,7 +58,6 @@ export class FirefoxCookieQueryStrategy implements CookieQueryStrategy { /** * Queries cookies from Firefox's cookie store - * * @param name - The name pattern to match cookies against * @param domain - The domain pattern to match cookies against * @returns A promise that resolves to an array of exported cookies diff --git a/src/core/browsers/getEncryptedChromeCookie.ts b/src/core/browsers/getEncryptedChromeCookie.ts index c36c4de..9544c55 100644 --- a/src/core/browsers/getEncryptedChromeCookie.ts +++ b/src/core/browsers/getEncryptedChromeCookie.ts @@ -30,7 +30,6 @@ interface SqlQuery { /** * Validates if a path is a valid, existing file - * * @param path - Path to validate * @returns true if path is valid and file exists, false otherwise */ @@ -49,7 +48,6 @@ function isValidFilePath(path: unknown): path is string { /** * Get paths to Chrome cookie files - * * @returns A promise that resolves to an array of file paths */ async function getCookieFiles(): Promise { @@ -74,7 +72,6 @@ async function getCookieFiles(): Promise { /** * Builds the SQL query for retrieving cookies - * * @param name - Cookie name to search for * @param domain - Domain to filter by * @returns SQL query and parameters @@ -91,7 +88,6 @@ function buildSqlQuery(name: string, domain: string): SqlQuery { /** * Processes a single cookie file to extract matching cookies - * * @param cookieFile - Path to the cookie file * @param name - Cookie name to search for * @param domain - Domain to filter by @@ -131,7 +127,6 @@ async function processCookieFile( /** * Retrieve encrypted cookies from Chrome's cookie store - * * @param options - Options for querying Chrome cookies * @param options.name - The name of the cookie to retrieve * @param options.domain - The domain to retrieve cookies from diff --git a/src/core/browsers/listChromeProfiles.ts b/src/core/browsers/listChromeProfiles.ts index 347648f..a1fa755 100644 --- a/src/core/browsers/listChromeProfiles.ts +++ b/src/core/browsers/listChromeProfiles.ts @@ -13,7 +13,9 @@ const consola = logger.withTag("listChromeProfiles"); /** * Lists all Chrome profile paths that contain cookie files - * + * @internal + * @returns An array of absolute paths to Chrome cookie files + * @throws {Error} If Chrome's application support directory cannot be accessed * @example * ```typescript * // Get all Chrome cookie file paths @@ -30,10 +32,6 @@ const consola = logger.withTag("listChromeProfiles"); * console.error('Failed to access Chrome profiles:', error); * } * ``` - * - * @returns An array of absolute paths to Chrome cookie files - * @throws {Error} If Chrome's application support directory cannot be accessed - * @internal */ export function listChromeProfilePaths(): string[] { const files: string[] = sync(`./**/Cookies`, { @@ -47,7 +45,6 @@ export function listChromeProfilePaths(): string[] { /** * Chrome Local State file structure - * * @internal */ interface ChromeLocalState { @@ -58,7 +55,6 @@ interface ChromeLocalState { /** * Chrome profile information structure - * * @property {string} name - The name of the profile * @property {number} active_time - Unix timestamp of last profile activity * @property {string} account_id - Unique identifier for the Chrome profile @@ -101,7 +97,9 @@ interface ChromeProfileInfo { /** * Lists all Chrome profiles and their associated information - * + * @internal + * @returns An array of Chrome profile information objects. Returns empty array if profiles cannot be read + * @throws {Error} If Chrome's application support directory cannot be accessed * @example * ```typescript * // Get all Chrome profiles @@ -122,10 +120,6 @@ interface ChromeProfileInfo { * console.log('No Chrome profiles found or error occurred'); * } * ``` - * - * @returns An array of Chrome profile information objects. Returns empty array if profiles cannot be read - * @throws {Error} If Chrome's application support directory cannot be accessed - * @internal */ export function listChromeProfiles(): ChromeProfileInfo[] { try { diff --git a/src/core/browsers/mock/MockCookieQueryStrategy.ts b/src/core/browsers/mock/MockCookieQueryStrategy.ts index 4fa7d82..f33e0ee 100644 --- a/src/core/browsers/mock/MockCookieQueryStrategy.ts +++ b/src/core/browsers/mock/MockCookieQueryStrategy.ts @@ -4,7 +4,6 @@ import type { ExportedCookie } from "../../../types/ExportedCookie"; /** * A mock implementation of CookieQueryStrategy for testing purposes. * Provides a way to simulate cookie querying behavior without a real browser. - * * @example * // Initialize with mock cookies * const mockCookies = [ @@ -23,25 +22,21 @@ import type { ExportedCookie } from "../../../types/ExportedCookie"; export default class MockCookieQueryStrategy implements CookieQueryStrategy { /** * Name identifier for the mock browser implementation - * - * @readonly * @internal + * @readonly */ public readonly browserName: string = "mock"; /** * Internal storage for mock cookie data - * - * @private * @internal + * @private */ private readonly mockCookies: ExportedCookie[]; /** * Creates a new instance of MockCookieQueryStrategy - * * @param mockCookies - Array of cookies to use as mock data. Defaults to empty array if not provided. - * * @example * // Initialize with single cookie * const strategy = new MockCookieQueryStrategy([ @@ -63,11 +58,9 @@ export default class MockCookieQueryStrategy implements CookieQueryStrategy { /** * Queries cookies matching the given name and domain - * * @param name - The name of the cookie to query, or "*" for all names * @param domain - The domain of the cookie to query, or "*" for all domains * @returns Promise resolving to array of matching cookies - * * @example * const strategy = new MockCookieQueryStrategy([ * { name: 'session', domain: 'example.com', value: '123' } @@ -94,9 +87,7 @@ export default class MockCookieQueryStrategy implements CookieQueryStrategy { /** * Returns all mock cookies - * * @returns Promise resolving to array of all mock cookies - * * @example * const strategy = new MockCookieQueryStrategy([ * { name: 'session', domain: 'example.com', value: '123' }, diff --git a/src/core/cookies/CookieStore.ts b/src/core/cookies/CookieStore.ts index 7c29bf3..4950d53 100644 --- a/src/core/cookies/CookieStore.ts +++ b/src/core/cookies/CookieStore.ts @@ -4,7 +4,6 @@ const cookieJar = new CookieJar(); /** * Promise that resolves to a CookieJar instance for handling cookie operations - * * @example * // Wait for cookie jar to be ready * const jar = await cookieJarPromise; @@ -20,7 +19,6 @@ export const cookieJarPromise = Promise.resolve(cookieJar); /** * Promise that resolves to a CookieJar instance for cookie storage operations - * * @example * // Wait for cookie store to be ready * const store = await cookieStorePromise; diff --git a/src/core/cookies/SpecialCases.ts b/src/core/cookies/SpecialCases.ts index 53462a3..1c451f5 100644 --- a/src/core/cookies/SpecialCases.ts +++ b/src/core/cookies/SpecialCases.ts @@ -2,7 +2,6 @@ import type { CookieSpec } from "../../types/CookieSpec"; /** * Check if a cookie specification contains wildcard patterns - * * @param cookieSpec - The cookie specification to check * @returns True if the cookie spec contains wildcard patterns, false otherwise * @example diff --git a/src/core/cookies/comboQueryCookieSpec.ts b/src/core/cookies/comboQueryCookieSpec.ts index 3d1c2e4..32f2e64 100644 --- a/src/core/cookies/comboQueryCookieSpec.ts +++ b/src/core/cookies/comboQueryCookieSpec.ts @@ -5,7 +5,6 @@ import { CompositeCookieQueryStrategy } from "../browsers/CompositeCookieQuerySt /** * Configuration options for cookie queries - * * @property {CookieQueryStrategy} [strategy] - Strategy to use for querying cookies * @property {number} [limit] - Maximum number of cookies to return * @property {boolean} [removeExpired] - Whether to filter out expired cookies @@ -18,10 +17,9 @@ interface QueryOptions { /** * Converts cookie expiry to consistent format - * + * @internal * @param cookie - The cookie object to convert expiry for * @returns The cookie object with converted expiry - * @internal */ function convertExpiry(cookie: ExportedCookie): ExportedCookie { if (cookie.expiry === "Infinity") { @@ -38,25 +36,21 @@ function convertExpiry(cookie: ExportedCookie): ExportedCookie { * * Allows querying cookies using either a single specification or multiple specifications * in parallel. Handles expiry dates and provides filtering options. - * * @param cookieSpec - The cookie specification(s) to query * @param options - Optional configuration for the query operation - * + * @returns A promise that resolves to an array of matching cookies * @example * // Query single cookie spec * const cookies = await comboQueryCookieSpec({ * name: "session", * domain: "example.com" * }); - * * @example * // Query multiple specs with expired cookie removal * const cookies = await comboQueryCookieSpec([ * { name: "auth", domain: "api.example.com" }, * { name: "prefs", domain: "example.com" } * ], { removeExpired: true }); - * - * @returns A promise that resolves to an array of matching cookies */ export async function comboQueryCookieSpec( cookieSpec: MultiCookieSpec, diff --git a/src/core/cookies/index.d.ts b/src/core/cookies/index.d.ts index 7175dfa..16cec6c 100644 --- a/src/core/cookies/index.d.ts +++ b/src/core/cookies/index.d.ts @@ -4,10 +4,8 @@ import type { ExportedCookie } from "../../types/ExportedCookie"; declare module "./getCookie" { /** * Retrieves browser cookies that match the specified cookie name and domain criteria - * * @param cookieSpec - The cookie specification containing search criteria * @returns A promise that resolves to an array of exported cookies - * * @example * ```typescript * import { getCookie } from 'get-cookie'; @@ -31,10 +29,8 @@ declare module "./getCookie" { declare module "./getChromeCookie" { /** * Retrieves Chrome browser cookies that match the specified cookie name and domain criteria - * * @param cookieSpec - The cookie specification containing search criteria * @returns A promise that resolves to an array of exported cookies - * * @example * ```typescript * import { getChromeCookie } from 'get-cookie'; @@ -60,10 +56,8 @@ declare module "./getChromeCookie" { declare module "./getFirefoxCookie" { /** * Retrieves Firefox browser cookies that match the specified cookie name and domain criteria - * * @param cookieSpec - The cookie specification containing search criteria * @returns A promise that resolves to an array of exported cookies - * * @example * ```typescript * import { getFirefoxCookie } from 'get-cookie'; @@ -89,10 +83,8 @@ declare module "./getFirefoxCookie" { declare module "./getGroupedRenderedCookies" { /** * Retrieves and renders cookies in a grouped format - * * @param cookieSpec - The cookie specification containing search criteria * @returns A promise that resolves to an array of rendered cookie strings - * * @example * ```typescript * import { getGroupedRenderedCookies } from 'get-cookie'; @@ -116,11 +108,9 @@ declare module "./getGroupedRenderedCookies" { declare module "./getMergedRenderedCookies" { /** * Retrieves and renders cookies in a merged format - * * @param cookieSpec - The cookie specification containing search criteria * @param options - Optional rendering options * @returns A promise that resolves to a single rendered cookie string - * * @example * ```typescript * import { getMergedRenderedCookies } from 'get-cookie'; diff --git a/src/core/cookies/resultsRendered.ts b/src/core/cookies/resultsRendered.ts index c3680a2..7ce9981 100644 --- a/src/core/cookies/resultsRendered.ts +++ b/src/core/cookies/resultsRendered.ts @@ -3,11 +3,9 @@ import type { ExportedCookie } from "../../types/ExportedCookie"; /** * Formats cookie query results into a human-readable string representation. * Supports both basic and verbose output formats. - * * @param cookies - Array of cookie objects to format. Each cookie must have at least name and value properties * @param verbose - When true, includes additional details like domain, expiry, and metadata * @returns A formatted string with one cookie per line - * * @example * // Basic usage * const cookies = [{ name: 'sessionId', value: '123abc' }]; @@ -15,7 +13,6 @@ import type { ExportedCookie } from "../../types/ExportedCookie"; * // Returns: * // Found 1 cookie: * // - sessionId=123abc - * * @example * // Verbose output with multiple cookies * const cookies = [{ diff --git a/src/paths.ts b/src/paths.ts index ae59161..a382224 100644 --- a/src/paths.ts +++ b/src/paths.ts @@ -1,6 +1,5 @@ /** * Mapping of module aliases to their corresponding import paths - * * @example * // Access path aliases * console.log(paths.core); // '@core' @@ -18,7 +17,6 @@ export const paths = { /** * Type representing the structure of the paths object - * * @example * // Type usage in function parameters * function getPath(key: keyof Paths): string { @@ -33,7 +31,6 @@ export type Paths = typeof paths; /** * Type representing the valid keys of the paths object - * * @example * // Use as function parameter type * function validatePath(key: PathKeys): boolean { diff --git a/src/tests/CookieSpec.ts b/src/tests/CookieSpec.ts index 0e6ddad..36c1574 100644 --- a/src/tests/CookieSpec.ts +++ b/src/tests/CookieSpec.ts @@ -1,6 +1,5 @@ /** * Specification for a cookie to query - * * @example */ export interface CookieSpec { @@ -12,7 +11,6 @@ export interface CookieSpec { /** * Array of cookie specifications to query - * * @example */ export type MultiCookieSpec = CookieSpec[]; diff --git a/src/tests/browsers/mock/MockCookieQueryStrategy.ts b/src/tests/browsers/mock/MockCookieQueryStrategy.ts index 461e5d4..de33c48 100644 --- a/src/tests/browsers/mock/MockCookieQueryStrategy.ts +++ b/src/tests/browsers/mock/MockCookieQueryStrategy.ts @@ -4,7 +4,6 @@ import type { ExportedCookie } from "../../../types/ExportedCookie"; /** * Mock implementation of CookieQueryStrategy for testing - * * @example */ export default class MockCookieQueryStrategy implements CookieQueryStrategy { @@ -15,14 +14,12 @@ export default class MockCookieQueryStrategy implements CookieQueryStrategy { /** * Creates a new instance of MockCookieQueryStrategy - * * @param mockCookies - Array of mock cookies to use for testing */ public constructor(private mockCookies: ExportedCookie[]) {} /** * Queries mock cookies based on name and domain patterns - * * @param name - The name pattern to match cookies against * @param domain - The domain pattern to match cookies against * @returns A promise that resolves to an array of matching cookies diff --git a/src/tests/getMergedRenderedCookies.ts b/src/tests/getMergedRenderedCookies.ts index 2ee6196..ca666c8 100644 --- a/src/tests/getMergedRenderedCookies.ts +++ b/src/tests/getMergedRenderedCookies.ts @@ -7,7 +7,6 @@ import type { MultiCookieSpec } from "./CookieSpec"; /** * Renders multiple cookies into a single string suitable for use in HTTP headers - * * @param cookies - Array of cookies to render * @returns A string containing all cookies in HTTP header format */ @@ -20,7 +19,6 @@ const renderCookies = memoize( /** * Queries and merges cookies based on multiple specifications - * * @param cookieSpecs - Array of cookie specifications to query * @param strategy - Strategy to use for querying cookies * @returns A promise that resolves to a string containing all matched cookies diff --git a/src/tests/readGithubCookies.ts b/src/tests/readGithubCookies.ts index f593734..ad0f400 100644 --- a/src/tests/readGithubCookies.ts +++ b/src/tests/readGithubCookies.ts @@ -1,6 +1,5 @@ /** * Checks if a string matches the basic JWT format - * * @param str - The string to check * @returns True if the string matches JWT format, false otherwise * @example diff --git a/src/types/BrowserName.ts b/src/types/BrowserName.ts index 6b8133f..b290090 100644 --- a/src/types/BrowserName.ts +++ b/src/types/BrowserName.ts @@ -1,6 +1,5 @@ /** * Valid browser names in the application - * * @example * // Type usage in function parameters * function getBrowserCookies(browser: BrowserName): Promise { diff --git a/src/types/CookieQueryStrategy.ts b/src/types/CookieQueryStrategy.ts index 716deb4..0a6385f 100644 --- a/src/types/CookieQueryStrategy.ts +++ b/src/types/CookieQueryStrategy.ts @@ -3,7 +3,6 @@ import type { ExportedCookie } from "./ExportedCookie"; /** * Interface for implementing browser-specific cookie query strategies. * This interface defines the contract for querying cookies from different browser implementations. - * * @example */ export interface CookieQueryStrategy { @@ -14,7 +13,6 @@ export interface CookieQueryStrategy { /** * Query cookies from the browser's storage - * * @param name - The name of the cookie to query * @param domain - The domain to query cookies from * @returns A promise that resolves to an array of exported cookies diff --git a/src/types/CookieRow.ts b/src/types/CookieRow.ts index 4c01eba..b841eb9 100644 --- a/src/types/CookieRow.ts +++ b/src/types/CookieRow.ts @@ -3,7 +3,6 @@ import logger from "@utils/logger"; /** * Represents a raw cookie row from a browser's cookie store * Contains the essential properties of a cookie before processing - * * @example */ export interface CookieRow { @@ -19,7 +18,6 @@ export interface CookieRow { /** * Type guard to check if an object matches the CookieRow interface - * * @param obj - The object to check * @returns True if the object is a valid CookieRow, false otherwise * @example diff --git a/src/types/CookieSchema.ts b/src/types/CookieSchema.ts index c5b702c..6a2926f 100644 --- a/src/types/CookieSchema.ts +++ b/src/types/CookieSchema.ts @@ -3,7 +3,6 @@ import { z } from "zod"; /** * Schema for cookie specification parameters * Defines the required fields for identifying a cookie - * * @example * // Validate a cookie specification * const spec = { @@ -35,7 +34,6 @@ export const CookieSpecSchema = z /** * Schema for exported cookie data * Represents a cookie with all its properties and metadata - * * @example * // Validate an exported cookie * const cookie = { @@ -82,7 +80,6 @@ export const ExportedCookieSchema = z /** * Type definition for cookie specification * Used for specifying which cookie to query - * * @example * // Basic cookie spec * const spec: CookieSpec = { @@ -106,7 +103,6 @@ export type CookieSpec = z.infer; /** * Type definition for exported cookie data * Represents the structure of a cookie after it has been retrieved - * * @example * // Basic exported cookie * const cookie: ExportedCookie = { diff --git a/src/types/ZodUtils.ts b/src/types/ZodUtils.ts index 2ed7ae6..c01873e 100644 --- a/src/types/ZodUtils.ts +++ b/src/types/ZodUtils.ts @@ -2,28 +2,24 @@ import { z } from "zod"; /** * Represents a successful parse result from Zod - * * @example */ export type SafeParseSuccess = { success: true; data: T }; /** * Represents a failed parse result from Zod - * * @example */ export type SafeParseError = { success: false; error: z.ZodError }; /** * Represents either a successful or failed parse result from Zod - * * @example */ export type SafeParseResult = SafeParseSuccess | SafeParseError; /** * Type guard to check if a parse result is successful - * * @param result - The parse result to check * @returns True if the result is a successful parse, false otherwise * @example @@ -36,7 +32,6 @@ export function isParseSuccess( /** * Type guard to check if a parse result is an error - * * @param result - The parse result to check * @returns True if the result is a parse error, false otherwise * @example diff --git a/src/utils/__mocks__/logger.ts b/src/utils/__mocks__/logger.ts index 18ce16c..015d13a 100644 --- a/src/utils/__mocks__/logger.ts +++ b/src/utils/__mocks__/logger.ts @@ -13,7 +13,6 @@ const mockLogger = { * Mock logger for testing purposes * Provides jest mock functions for all logging methods * Each method (debug, info, warn, error, log) is a jest.fn() that can be used to verify calls - * * @example */ export default mockLogger; diff --git a/src/utils/findAllFiles.ts b/src/utils/findAllFiles.ts index 211513b..769ae85 100644 --- a/src/utils/findAllFiles.ts +++ b/src/utils/findAllFiles.ts @@ -13,14 +13,18 @@ type FindFilesOptions = { /** * Finds all files matching the specified name within a given path and depth. - * + * @param options - The options for finding files. + * @param options.path - The path to search within. + * @param options.name - The name of the files to search for. + * @param [options.maxDepth] - The maximum depth to search within. + * @returns An array of file paths that match the search criteria. + * @throws Will throw an error if the specified path does not exist. * @example * // Find all package.json files up to 2 levels deep * const files = findAllFiles({ * path: './src', * name: 'package.json' * }); - * * @example * // Find all test files with custom depth * try { @@ -33,14 +37,6 @@ type FindFilesOptions = { * } catch (error) { * console.error('Failed to find test files:', error.message); * } - * - * @param options - The options for finding files. - * @param options.path - The path to search within. - * @param options.name - The name of the files to search for. - * @param [options.maxDepth] - The maximum depth to search within. - * - * @returns An array of file paths that match the search criteria. - * @throws Will throw an error if the specified path does not exist. */ export function findAllFiles({ path, diff --git a/src/utils/logger.ts b/src/utils/logger.ts index 47bc051..ad6947f 100644 --- a/src/utils/logger.ts +++ b/src/utils/logger.ts @@ -24,7 +24,6 @@ const consola = createConsola({ /** * Configured consola logger instance with standardized formatting and colored output. * Used for consistent logging throughout the application. - * * @example * // Basic usage * logger.info('Operation started');