Skip to content

Conversation

@jpcanepa
Copy link
Contributor

The type for the state field of the ServerOptions object was qualified with a TODO that questioned if the type should be the full ServerStateCookieOptions or just those fields defined in the default value. Given the documentation (and validated by actual usage), the correct type is indeed the one the TODO presumed.

This PR replaces the ad-hoc type with the proper already-existing type, and gets rid of the TODO.

This change is intrinsically safe as the type is an strict superset of the one being in use today, with all extra fields being optional.

@jpcanepa jpcanepa changed the title Correct type of state object Correct type for state object Jul 30, 2025
Copy link
Contributor

@damusix damusix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kanongil kanongil added the types TypeScript type definitions label Aug 2, 2025
@Marsup Marsup self-assigned this Aug 4, 2025
@Marsup Marsup added this to the 21.4.1 milestone Aug 4, 2025
@Marsup Marsup merged commit aedef7c into hapijs:master Aug 4, 2025
10 checks passed
@Marsup Marsup modified the milestones: 21.4.1, 21.4.2 Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

types TypeScript type definitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants