We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instead of
be-pkg-utils/src/session.ts
Lines 17 to 23 in e969374
export function extractProfileFeatures(session: UserSession | EResidentSession): ProfileFeature[] { if (!Object.hasOwn(session, 'features')) return [] return profileFeaturesToList(session.features) }
It is also not ok to have such an uncertain union type UserSession | EResidentSession, may we change it to certain single interface?
UserSession | EResidentSession
The text was updated successfully, but these errors were encountered:
Замість коду, який ви запропонували, хочу запропонувати свій варіант — він коротший та елегантніший.
export function extractProfileFeatures(session: UserSession | EResidentSession): ProfileFeature[] { return Object.hasOwn(session, 'features') ? profileFeaturesToList(session.features) : []; }
Але тут ще можна дуже багато покращити. Можливо, мій варіант більше підійде розробнику.
Sorry, something went wrong.
No branches or pull requests
Instead of
be-pkg-utils/src/session.ts
Lines 17 to 23 in e969374
consider following:
It is also not ok to have such an uncertain union type
UserSession | EResidentSession
, may we change it to certain single interface?The text was updated successfully, but these errors were encountered: