-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
| export async function setUserSession(event: H3Event, data: OmitWithIndexSignature<UserSession, 'id'>, config?: Partial<SessionConfig>): Promise<UserSession> { |
Suggest to wrap data parameter type in setUserSession function with SubSet(maybe DeepPartial)
// Credits: https://norday.tech/posts/2021/typescript-partial/
type Subset<K> = {
[attr in keyof K]?: K[attr] extends object
? Subset<K[attr]>
: K[attr] extends object | null
? Subset<K[attr]> | null
: K[attr] extends object | null | undefined
? Subset<K[attr]> | null | undefined
: K[attr];
};that will suppress that error:
// Type '{ foo: string; }' is missing the following properties from type 'User': id, name, email, image, and 3
await setUserSession(event, {
user: {
foo: normalizedAddress,
},
});Metadata
Metadata
Assignees
Labels
No labels