Skip to content

Commit

Permalink
fix(preset-mini): Cannot read properties of undefined (reading 'split…
Browse files Browse the repository at this point in the history
…') (#3662)
  • Loading branch information
Simon-He95 committed Mar 28, 2024
1 parent 264436d commit 31003d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/preset-mini/src/_utils/handlers/handlers.ts
Expand Up @@ -84,6 +84,8 @@ export function auto(str: string) {
}

export function rem(str: string) {
if (!str)
return
if (unitOnlyRE.test(str))
return `1${str}`
const match = str.match(numberWithUnitRE)
Expand Down Expand Up @@ -129,6 +131,8 @@ export function percent(str: string) {
}

export function fraction(str: string) {
if (!str)
return
if (str === 'full')
return '100%'
const [left, right] = str.split('/')
Expand Down

0 comments on commit 31003d2

Please sign in to comment.