refactor: replace .forEach()
with for-of
(#39691)
* refactor: replace `.forEach()` with `for-of` * refactor docs/fiddles/features/web-hid/renderer.js
This commit is contained in:
parent
7858921a1f
commit
0b0707145b
32 changed files with 144 additions and 132 deletions
|
@ -32,7 +32,7 @@ describe('systemPreferences module', () => {
|
|||
] as const;
|
||||
|
||||
const defaultsDict: Record<string, any> = {};
|
||||
defaultsMap.forEach(row => { defaultsDict[row.key] = row.value; });
|
||||
for (const row of defaultsMap) { defaultsDict[row.key] = row.value; }
|
||||
|
||||
systemPreferences.registerDefaults(defaultsDict);
|
||||
|
||||
|
@ -160,10 +160,10 @@ describe('systemPreferences module', () => {
|
|||
it('returns a valid system color', () => {
|
||||
const colors = ['blue', 'brown', 'gray', 'green', 'orange', 'pink', 'purple', 'red', 'yellow'] as const;
|
||||
|
||||
colors.forEach(color => {
|
||||
for (const color of colors) {
|
||||
const sysColor = systemPreferences.getSystemColor(color);
|
||||
expect(sysColor).to.be.a('string');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -211,10 +211,10 @@ describe('systemPreferences module', () => {
|
|||
'window-frame-text'
|
||||
] as const;
|
||||
|
||||
colors.forEach(color => {
|
||||
for (const color of colors) {
|
||||
const sysColor = systemPreferences.getColor(color);
|
||||
expect(sysColor).to.be.a('string');
|
||||
});
|
||||
}
|
||||
|
||||
await expectDeprecationMessages(
|
||||
() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue