Skip to content

Commit

Permalink
feat(preset-icons): throw error when prefix empty
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed May 6, 2024
1 parent 6bba916 commit 84763be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/preset-icons/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export function createPresetIcons(lookupIconLoader: (options: IconsOptions) => P
unit,
} = options

// eslint-disable-next-line unicorn/prefer-includes
if (prefix === '' || (Array.isArray(prefix) && prefix.some(p => p === '')))
throw new Error('prefix cannot be empty')

const flags = getEnvFlags()

const loaderOptions: IconifyLoaderOptions = {
Expand Down

0 comments on commit 84763be

Please sign in to comment.