chore(utils): remove unnecessary as string (#4805)

This commit is contained in:
btea 2021-12-12 23:44:29 -06:00 committed by GitHub
parent 7caa13e80c
commit dda60bd200
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,13 +3,12 @@ import { isNumber } from './util'
export const isValidWidthUnit = (val: string | number): boolean => {
if (isNumber(val)) {
return true
} else {
return (
['px', 'rem', 'em', 'vw', '%', 'vmin', 'vmax'].some((unit) =>
(val as string).endsWith(unit)
) || (val as string).startsWith('calc')
)
}
return (
['px', 'rem', 'em', 'vw', '%', 'vmin', 'vmax'].some((unit) =>
val.endsWith(unit)
) || val.startsWith('calc')
)
}
export const isValidComponentSize = (val: string) =>