Skip to content

SitemapIndexEntry.loc fallback to (entry as any).url is undocumented and breaks type safety #47

Description

@fomadev-admin

Description:
In index-builder.ts L30:

const targetLoc = entry.loc || (entry as any).url || '';

This silently accepts an undocumented url field on SitemapIndexEntry using as any, bypassing TypeScript. This is an implicit API surface that:

  1. Is not reflected in the SitemapIndexEntry type
  2. Is not documented in README or DOCUMENTATION.md
  3. Could lead to confusion (should I use loc or url?)

Recommendation: Either formally support url as an alias in the type (e.g., url?: string) or remove the fallback and enforce strict loc-only usage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions