From af90ba953502969a7c38e100740f22778dd260ba Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 15 Nov 2025 23:39:55 +0000 Subject: [PATCH 1/4] Fix reactivity issue for CIDR to mask (#27) --- src/routes/cidr/mask-converter/+layout.svelte | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/routes/cidr/mask-converter/+layout.svelte b/src/routes/cidr/mask-converter/+layout.svelte index 836eb41f..16304f72 100644 --- a/src/routes/cidr/mask-converter/+layout.svelte +++ b/src/routes/cidr/mask-converter/+layout.svelte @@ -32,13 +32,17 @@ function getSubnetInfo(c: number) { const subnet = COMMON_SUBNETS.find((s) => s.cidr === c); - return ( - subnet || { - cidr: c, - mask: cidrToMask(c).octets.join('.'), - hosts: Math.pow(2, 32 - c) - 2, - } - ); + if (subnet) return subnet; + + // Calculate usable hosts per RFC 3021 + const totalAddresses = Math.pow(2, 32 - c); + const hosts = c === 32 ? 1 : c === 31 ? 2 : totalAddresses - 2; + + return { + cidr: c, + mask: cidrToMask(c).octets.join('.'), + hosts, + }; } const subnetInfo = derived(cidr, ($c) => getSubnetInfo($c)); @@ -121,7 +125,7 @@
Usable Hosts - {get(subnetInfo).hosts.toLocaleString()} + {$subnetInfo.hosts.toLocaleString()}
From 25ce3708d19a87eb0313ec4304d09b7d1bc33386 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 16 Nov 2025 00:56:51 +0000 Subject: [PATCH 2/4] Updates codacy config --- .codacy.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.codacy.yml b/.codacy.yml index ed54cead..4fa1132d 100644 --- a/.codacy.yml +++ b/.codacy.yml @@ -19,10 +19,6 @@ duplication: exclude_paths: - "tests/**" -engines: - eslint: - config_file: eslintrc.config.js - # Exclude patterns - ignore test files and build artifacts from analysis exclude_paths: - "tests/**" @@ -47,6 +43,7 @@ engines: # ESLint configuration (if you want to customize) eslint: enabled: true + config_file: eslintrc.config.js exclude_paths: - "tests/**" @@ -56,12 +53,6 @@ engines: exclude_paths: - "tests/**" -# Additional configuration -duplication: - enabled: true - exclude_paths: - - "tests/**" - # Complexity and code style checks metrics: enabled: true From 194ba7a083c65ce3fe236e69e75bee63a3322865 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 16 Nov 2025 00:57:05 +0000 Subject: [PATCH 3/4] Removes obsolete debugs --- src/lib/stores/theme.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/stores/theme.ts b/src/lib/stores/theme.ts index 5affb88d..92e044f7 100644 --- a/src/lib/stores/theme.ts +++ b/src/lib/stores/theme.ts @@ -64,17 +64,7 @@ function loadCustomFont(fontConfig: { name: string; url: string; fallback?: stri if (fontLoaded) { document.documentElement.classList.remove('fonts-loading'); document.documentElement.classList.add('fonts-loaded'); - logger.debug(`Font loaded successfully: ${fontFamily}`, { - font: fontFamily, - component: 'ThemeStore', - }); } else { - // Font stylesheet loaded but font not available yet - logger.debug(`Font stylesheet loaded, waiting for font: ${fontFamily}`, { - font: fontFamily, - component: 'ThemeStore', - }); - // Set a timeout fallback (3 seconds) setTimeout(() => { document.documentElement.classList.remove('fonts-loading'); From 6fbeb957b7d94432de676652144e6ae5fbf7b2de Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 16 Nov 2025 01:01:24 +0000 Subject: [PATCH 4/4] Bumps to 1.6.0, for new release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e629a75..25e7cb20 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "networking-toolbox", "private": true, - "version": "1.5.0", + "version": "1.6.0", "type": "module", "scripts": { "dev": "vite dev",