kollapsminoriteten/wp-content/themes/blocksy/static/js/options/helpers/parse-choices.js

14 lines
251 B
JavaScript
Raw Normal View History

2025-08-27 08:44:30 +02:00
export const maybeTransformUnorderedChoices = choices =>
Array.isArray(choices)
? choices
: Object.keys(choices).reduce(
(current, choice) => [
...current,
{
key: choice,
value: choices[choice]
}
],
[]
)