Skip to content

Commit

Permalink
Merge pull request #80 from pvaneveld/fix/exclude_empty_options_type_fix
Browse files Browse the repository at this point in the history
fix: make option type value driven
  • Loading branch information
dohomi authored Feb 3, 2025
2 parents e9a1f67 + 35b89cb commit 0b7f7f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ export default async function storyblokToTypescript({
options = element.options.map(item => item.value);
}

if (options.length && element.exclude_empty_option !== true) {
options.unshift('')
if (options.length && element.exclude_empty_option === true) {
options = options.filter(option => option !== "")
}

// option types with source self do not have a source field but the options as array
Expand Down

0 comments on commit 0b7f7f5

Please sign in to comment.