perf(ivy): remove extra SafeStyle detection code (#32775)

PR Close #32775
This commit is contained in:
Matias Niemelä
2019-09-19 12:59:12 -07:00
committed by Andrew Kushnir
parent 5651fa3a95
commit 52552b0520
2 changed files with 3 additions and 16 deletions

View File

@ -166,27 +166,14 @@ export function getPropValuesStartPosition(context: TStylingContext) {
return startPosition;
}
export function isMapBased(prop: string) {
return prop === MAP_BASED_ENTRY_PROP_NAME;
}
export function hasValueChanged(
a: NO_CHANGE | StylingMapArray | number | String | string | null | boolean | undefined | {},
b: NO_CHANGE | StylingMapArray | number | String | string | null | boolean | undefined |
{}): boolean {
if (b === NO_CHANGE) return false;
let compareValueA = Array.isArray(a) ? a[StylingMapArrayIndex.RawValuePosition] : a;
let compareValueB = Array.isArray(b) ? b[StylingMapArrayIndex.RawValuePosition] : b;
// these are special cases for String based values (which are created as artifacts
// when sanitization is bypassed on a particular value)
if (compareValueA instanceof String) {
compareValueA = compareValueA.toString();
}
if (compareValueB instanceof String) {
compareValueB = compareValueB.toString();
}
const compareValueA = Array.isArray(a) ? a[StylingMapArrayIndex.RawValuePosition] : a;
const compareValueB = Array.isArray(b) ? b[StylingMapArrayIndex.RawValuePosition] : b;
return !Object.is(compareValueA, compareValueB);
}