Skip to content

Commit

Permalink
chore: remove loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Assunção authored and Charles Assunção committed Jan 15, 2025
1 parent d72d2c1 commit 85cb929
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/devtools/getResetDebugSequence.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('getResetDebugSequence', () => {
[resetClassName!]: expect.stringContaining('margin:0'), // Match partial rule content
},
sequenceHash: resetClassName,
slot: resetClassName,
slot: 'makeResetStyles()',
});
});

Expand Down Expand Up @@ -68,7 +68,7 @@ describe('getResetDebugSequence', () => {
[resetClassName!]: expect.stringMatching(/margin:0.*padding:0.*border:none/),
},
sequenceHash: resetClassName,
slot: resetClassName,
slot: 'makeResetStyles()',
});
});
});
15 changes: 7 additions & 8 deletions packages/core/src/devtools/getResetDebugSequence.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { SequenceHash } from '../types';
import { debugData } from './store';
import type { DebugSequence } from './types';

export function getResetDebugSequence(debugSequenceHash: SequenceHash, parentNode?: DebugSequence) {
export function getResetDebugSequence(debugSequenceHash: SequenceHash) {
const resetClass = DEBUG_RESET_CLASSES[debugSequenceHash];
if (resetClass === undefined) {
return undefined;
Expand All @@ -19,15 +19,14 @@ export function getResetDebugSequence(debugSequenceHash: SequenceHash, parentNod
};

node.rules = {};
node.debugClassNames.forEach(({ className }) => {
node.slot = 'makeResetStyles()';
node.slot = 'makeResetStyles()';

const cssRule = debugData.getCSSRules().find(cssRule => {
return cssRule.includes(className);
});

node.rules![className] = cssRule!;
const [{ className }] = node.debugClassNames;
const cssRule = debugData.getCSSRules().find(cssRule => {
return cssRule.includes(className);
});

node.rules![className] = cssRule!;

return node;
}

0 comments on commit 85cb929

Please sign in to comment.