Skip to content
New issue

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

internal: allow choices with null value #28301

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
internal: allow choices with null value
  • Loading branch information
mshima committed Dec 26, 2024
commit a3e43c2273c63549e527718860a328a8ec06cdf7
3 changes: 2 additions & 1 deletion lib/utils/derived-property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { camelCase, upperFirst } from 'lodash-es';
import type { JHipsterChoices } from '../command/types.js';
import { upperFirstCamelCase } from './string.js';

const flatChoices = (choices: JHipsterChoices): string[] => choices.map(choice => (typeof choice === 'string' ? choice : choice.value));
const flatChoices = (choices: JHipsterChoices): string[] =>
choices.map(choice => (typeof choice === 'string' ? choice : choice.value)).filter(Boolean);

export const applyDerivedProperty = <const Prop extends string>(
data: any,
Expand Down
Loading