@mulmoclaude/common 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/envScan.js CHANGED
@@ -23,10 +23,10 @@ export function snakeToLowerCamel(snake) {
23
23
  .toLowerCase()
24
24
  .split("_")
25
25
  .filter((segment) => segment.length > 0);
26
- if (parts.length === 0)
27
- return "";
28
26
  const [head, ...rest] = parts;
29
- return head + rest.map((part) => part[0].toUpperCase() + part.slice(1)).join("");
27
+ if (head === undefined)
28
+ return "";
29
+ return head + rest.map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
30
30
  }
31
31
  function claimByHighestPrefix(name, prefixes) {
32
32
  const claimed = prefixes
package/dist/ssrf.js CHANGED
@@ -67,12 +67,13 @@ export function stripIpv6Brackets(hostname) {
67
67
  * `[::ffff:127.0.0.1]` as `::ffff:7f00:1`, so matching only the dotted form
68
68
  * would wave the mapped loopback through any URL-sourced check. */
69
69
  function mappedIpv4Value(lower) {
70
- const dotted = /^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(lower);
71
- if (dotted)
72
- return ipv4ToInt(dotted[1]);
70
+ const dotted = /^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(lower)?.[1];
71
+ if (dotted !== undefined)
72
+ return ipv4ToInt(dotted);
73
73
  const hex = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(lower);
74
- if (hex)
75
- return Number.parseInt(hex[1], 16) * 0x10000 + Number.parseInt(hex[2], 16);
74
+ const [, high, low] = hex ?? [];
75
+ if (high !== undefined && low !== undefined)
76
+ return Number.parseInt(high, 16) * 0x10000 + Number.parseInt(low, 16);
76
77
  return null;
77
78
  }
78
79
  /** Blocks loopback/unspecified, fc00::/7 unique-local, fe80::/10 link-local,
@@ -86,7 +87,7 @@ export function isBlockedIpv6(address) {
86
87
  const mapped = mappedIpv4Value(lower);
87
88
  if (mapped !== null)
88
89
  return isBlockedIpv4Value(mapped);
89
- const [head] = lower.split(":");
90
+ const [head = ""] = lower.split(":");
90
91
  if (head.length === 0)
91
92
  return false;
92
93
  const leading = Number.parseInt(head, 16);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mulmoclaude/common",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "General-purpose pure utilities (type guards, etc.) shared across the MulmoClaude host, bridges, and plugins",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",