You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove the unnecessary as any casts on factory.ts lines 43–47 and the outdated comment that claims root and getCollectionDocument are "currently private." Task 6 (Issue #122) already made them public.
Finding Reference: F-NEW-01 from final-project-code-review.md Severity: Minor (BUG) Category: Type error / stale code Implementation Branch:phase-6
Problem Statement
factory.ts lines 43–47 contain:
// Access root and getCollectionDocument via `any` because they are// currently `private`. Task 6 (Issue #122) changes them to `public`;// these casts will be removed then.constep=endpointasany;
Issue #122 (Task 6) is complete. root is public get at endpoint.ts:67. getCollectionDocument is public at endpoint.ts:357. The as any cast:
Bypasses TypeScript's type system for no reason — loses all type checking on ep.getCollectionDocument() and ep.root
Has a misleading comment that looks like an unresolved TODO
Would confuse upstream reviewers who see as any and ask "why?"
Evidence:
// endpoint.ts line 67:publicgetroot(): Promise<OgcApiDocument>{// endpoint.ts line 357:publicgetCollectionDocument(collectionId: string): Promise<OgcApiDocument>{
Impact: No functional impact — code works identically. But the as any undermines type safety and the stale comment is misleading. This is on the clean-pr branch pushed to upstream PR #136.
Files to Create or Modify
File
Action
Est. Lines
Purpose
src/ogc-api/csapi/factory.ts
Modify
~5 changed
Remove as any cast, access endpoint.root and endpoint.getCollectionDocument() directly, delete stale comment
Proposed Fix
Remove the as any cast and access the public methods directly:
Task
Remove the unnecessary
as anycasts onfactory.tslines 43–47 and the outdated comment that claimsrootandgetCollectionDocumentare "currentlyprivate." Task 6 (Issue #122) already made thempublic.Finding Reference: F-NEW-01 from final-project-code-review.md
Severity: Minor (BUG)
Category: Type error / stale code
Implementation Branch:
phase-6Problem Statement
factory.tslines 43–47 contain:Issue #122 (Task 6) is complete.
rootispublic getatendpoint.ts:67.getCollectionDocumentispublicatendpoint.ts:357. Theas anycast:ep.getCollectionDocument()andep.rootas anyand ask "why?"Evidence:
Impact: No functional impact — code works identically. But the
as anyundermines type safety and the stale comment is misleading. This is on theclean-prbranch pushed to upstream PR #136.Files to Create or Modify
src/ogc-api/csapi/factory.tsas anycast, accessendpoint.rootandendpoint.getCollectionDocument()directly, delete stale commentProposed Fix
Remove the
as anycast and access the public methods directly:Delete the 3-line comment above the old cast.
Scope — What NOT to Touch
endpoint.ts— the visibility change is already complete (Issue P6 Task 6: Modify endpoint.ts — Remove CSAPI Coupling #122)index.ts(barrel file)factory.tsAcceptance Criteria
as anycast removed fromfactory.tsendpoint.rootandendpoint.getCollectionDocument()accessed directlynpx tsc --noEmitpasses (typecheck clean)npm run lintpassesnpm run test:nodepassesnpx prettier --check src/ogc-api/csapi/factory.tspassesDependencies
Blocked by: Nothing (Issue #122 already made the methods public)
Blocks: Nothing
Operational Constraints
Key constraints:
References
src/ogc-api/csapi/factory.tslines 43–47src/ogc-api/endpoint.tslines 67, 357