@@ -36,7 +36,7 @@ export const DEFAULT_TIMEOUTS = { goto: 15000, settle: 8000 };
3636 * ("https://site.test"), and trailing slashes, returning a consistent
3737 * origin like "https://site.test".
3838 *
39- * @param {string } domain - The domain to normalize.
39+ * @param {string } domain The domain to normalize.
4040 * @returns {string } The normalized origin.
4141 */
4242export function normalizeDomain ( domain ) {
@@ -77,8 +77,8 @@ const SAFE_SLUG_PART = /^[a-z0-9][a-z0-9._-]*$/i;
7777/**
7878 * Assert a value is safe to use as part of an output filename.
7979 *
80- * @param {string } value - The value to check.
81- * @param {string } kind - A label for the error message (e.g. "path key").
80+ * @param {string } value The value to check.
81+ * @param {string } kind A label for the error message (e.g. "path key").
8282 */
8383function assertSafeSlugPart ( value , kind ) {
8484 if (
@@ -101,8 +101,8 @@ function assertSafeSlugPart(value, kind) {
101101 * a `.join` TypeError at the very end of a compare run, and a crafted array
102102 * would be interpolated into the report's CSS.
103103 *
104- * @param {* } color - The configured color value.
105- * @param {string } name - The option name, for the error message.
104+ * @param {* } color The configured color value.
105+ * @param {string } name The option name, for the error message.
106106 */
107107function validateColor ( color , name ) {
108108 const valid =
@@ -125,7 +125,7 @@ function validateColor(color, name) {
125125 * setViewportSize() and fails mid-capture with an opaque error, so it is
126126 * cheaper to catch it up front with an actionable message.
127127 *
128- * @param {Array } viewports - The viewport definitions to validate.
128+ * @param {Array } viewports The viewport definitions to validate.
129129 */
130130export function validateViewports ( viewports ) {
131131 if ( ! Array . isArray ( viewports ) || viewports . length === 0 ) {
@@ -192,7 +192,7 @@ export function validateViewports(viewports) {
192192 * Anything with a scheme, path, or port is rejected up front — silently
193193 * matching nothing would read as "the block isn't working".
194194 *
195- * @param {* } blockHosts - The raw config value.
195+ * @param {* } blockHosts The raw config value.
196196 * @returns {string[] } Lowercased hostnames with any `*.` prefix removed.
197197 */
198198export function normalizeBlockHosts ( blockHosts ) {
@@ -203,15 +203,15 @@ export function normalizeBlockHosts(blockHosts) {
203203 if ( ! Array . isArray ( blockHosts ) ) {
204204 throw new Error (
205205 '❌ Invalid "blockHosts": expected an array of hostnames.\n' +
206- '💡 Use entries like ["challenges.cloudflare .com"].'
206+ '💡 Use entries like ["captcha.example .com"].'
207207 ) ;
208208 }
209209
210210 return blockHosts . map ( ( entry ) => {
211211 if ( typeof entry !== 'string' || ! entry . trim ( ) ) {
212212 throw new Error (
213213 `❌ Invalid "blockHosts" entry ${ JSON . stringify ( entry ) } : expected a non-empty string.\n` +
214- '💡 Use a bare hostname like "challenges.cloudflare .com".'
214+ '💡 Use a bare hostname like "captcha.example .com".'
215215 ) ;
216216 }
217217
@@ -220,7 +220,7 @@ export function normalizeBlockHosts(blockHosts) {
220220 if ( / [ / : \s ] / . test ( host ) ) {
221221 throw new Error (
222222 `❌ Invalid "blockHosts" entry ${ JSON . stringify ( entry ) } : expected a bare hostname (no scheme, port, or path).\n` +
223- '💡 Use "challenges.cloudflare .com", not "https://challenges.cloudflare .com/".'
223+ '💡 Use "captcha.example .com", not "https://captcha.example .com/".'
224224 ) ;
225225 }
226226
@@ -234,8 +234,8 @@ export function normalizeBlockHosts(blockHosts) {
234234 * A path that is already an absolute URL is returned untouched so that a
235235 * config can point individual entries at a different domain.
236236 *
237- * @param {string } domain - The normalized domain origin.
238- * @param {string } pathname - The path or absolute URL.
237+ * @param {string } domain The normalized domain origin.
238+ * @param {string } pathname The path or absolute URL.
239239 * @returns {string } The full URL.
240240 */
241241export function buildUrl ( domain , pathname ) {
@@ -253,8 +253,8 @@ export function buildUrl(domain, pathname) {
253253 * `control`/`compare` surfaces an actionable error instead of silently
254254 * doing nothing and printing a success-looking summary.
255255 *
256- * @param {Array } targets - The configured targets.
257- * @param {string[] } [only] - Path keys to keep. Falsy/empty keeps all.
256+ * @param {Array } targets The configured targets.
257+ * @param {string[] } [only] Path keys to keep. Falsy/empty keeps all.
258258 * @returns {Array } The filtered targets.
259259 */
260260export function filterTargets ( targets , only ) {
@@ -277,9 +277,9 @@ export function filterTargets(targets, only) {
277277/**
278278 * Load and normalize a reglance config file.
279279 *
280- * @param {object } [options] - Loader options.
281- * @param {string } [options.configPath] - Path to the config file.
282- * @param {string } [options.domain] - Domain override (e.g. from a flag).
280+ * @param {object } [options] Loader options.
281+ * @param {string } [options.configPath] Path to the config file.
282+ * @param {string } [options.domain] Domain override (e.g. from a flag).
283283 * @returns {object } The normalized config.
284284 */
285285export function loadConfig ( { configPath = 'reglance.json' , domain } = { } ) {
@@ -363,7 +363,7 @@ export function loadConfig({ configPath = 'reglance.json', domain } = {}) {
363363 * Writes a self-contained .gitignore inside the output directory so that
364364 * captures, diffs, and reports never get committed to the host project.
365365 *
366- * @param {object } config - The normalized config.
366+ * @param {object } config The normalized config.
367367 */
368368export function ensureOutputDir ( config ) {
369369 fs . mkdirSync ( config . outputDir , { recursive : true } ) ;
0 commit comments