Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if (currentMemoizedClassNames !== _memoizedClassNames) {
currentMemoizedClassNames = _memoizedClassNames;
map = new Map();
resultCount = 0;
}
if (!options.disableCaching) {
current = _traverseMap(map, styleFunctionOrObject as any);
current = _traverseMap(current, styleProps);
}
if (disableCaching || !(current as any)[RetVal]) {
if (styleFunctionOrObject === undefined) {
(current as any)[RetVal] = {} as IProcessedStyleSet;
} else {
(current as any)[RetVal] = mergeCssSets(
[
(typeof styleFunctionOrObject === 'function' ? styleFunctionOrObject(styleProps) : styleFunctionOrObject) as IStyleSet<
TStyleSet
>
],
{ rtl: !!rtl }
);
}
if (!disableCaching) {
resultCount++;
}
}
if (resultCount > MAX_CACHE_COUNT) {
map.clear();