,the fallback value would be passed to hint.transform. But by type definition it is already of target type and does not need any transformation. I added a test using a "complex" type to demonstrate.
I fixed the issue and also simplified the types to pass the TypeScript scrutiny. As this made the ClientHintsValue type obsolete, I took the liberty to move the ClientHint type to the main file and get rid of the utils one.
Let me know if you agree with the changes or need further changes.
Thanks! These changes break types in the Epic Stack because the Record<string, unknown> bit which results in the hints type resolving to unknown. Can you look into that?
Hey Kent,
I noticed that those
// @ts-expect-error
lines were hiding a type error for the call of the transform function if no cookieString value is present.Here:
,the fallback value would be passed to hint.transform. But by type definition it is already of target type and does not need any transformation. I added a test using a "complex" type to demonstrate.
I fixed the issue and also simplified the types to pass the TypeScript scrutiny. As this made the
ClientHintsValue
type obsolete, I took the liberty to move theClientHint
type to the main file and get rid of the utils one.Let me know if you agree with the changes or need further changes.
Best Alex