fix(core): safe important check (#10455)

This commit is contained in:
William Sedlacek
2023-12-19 10:11:10 -08:00
committed by GitHub
parent 4b74b96940
commit 172d3463a3
3 changed files with 10 additions and 4 deletions

View File

@@ -2,7 +2,11 @@ import { Trace } from '../../trace';
import { CoreTypes } from '../../core-types';
import { Length } from './style-properties';
export function cleanupImportantFlags(value: string, propertyName: string) {
export function cleanupImportantFlags(value: unknown, propertyName: string) {
if (typeof value !== 'string') {
return '' + value;
}
const index = value?.indexOf('!important');
if (index >= 0) {
if (Trace.isEnabled()) {