Skip to content

docs: fix three stale comments in src/index.ts - #438

Merged
matthewhudson merged 1 commit into
mainfrom
claude/stale-comments
Sep 30, 2026
Merged

matthewhudson merged 1 commit into
mainfrom
claude/stale-comments

Conversation

@matthewhudson

Copy link
Copy Markdown
Owner

Summary

The "stale comments" item in #421. Comments only; no code changes.

Line Before After
86 "Lowercase, so we can use the more efficient indexOf(), instead of Regex" Lowercased once, so the substring checks and the regexes can match lowercase text without case-insensitive flags. Three regexes (televisionModel, androidTabletModel, androidFoldablePhone) run against it now.
196 (was 191) "Check if element exists" on the includes() helper "Whether needle occurs anywhere in haystack", which is what it does.
510 (was 466) "Run device.js in noConflict mode" Says what it does (gives the device global back to its previous value, for pages where the name is taken) and drops the library's old name.

No changeset: nothing observable changes.

Test plan

  • Minified dist/index.global.js is byte-identical before and after
  • pnpm exec biome ci, pnpm run typecheck, pnpm run test (642 passed, 1 expected failure)

Generated by Claude Code

- The userAgent comment said it is lowercased so indexOf() can be used
  instead of a regex; three regexes now run against it too. It is
  lowercased so both kinds of check can skip case-insensitive flags.
- The includes() helper was described as "Check if element exists"; it
  is a substring test.
- noConflict() still referred to the library's old name, device.js.

Comments only; the minified bundle is byte-identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthewhudson
matthewhudson merged commit 7a0f396 into main Sep 30, 2026
3 checks passed
@matthewhudson
matthewhudson deleted the claude/stale-comments branch September 30, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant