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
|
@ -80,11 +80,11 @@ export function parseFeatures (features: string) {
|
|||
const parsed = parseCommaSeparatedKeyValue(features);
|
||||
|
||||
const webPreferences: { [K in AllowedWebPreference]?: any } = {};
|
||||
allowedWebPreferences.forEach((key) => {
|
||||
if (parsed[key] === undefined) return;
|
||||
for (const key of allowedWebPreferences) {
|
||||
if (parsed[key] === undefined) continue;
|
||||
webPreferences[key] = parsed[key];
|
||||
delete parsed[key];
|
||||
});
|
||||
}
|
||||
|
||||
if (parsed.left !== undefined) parsed.x = parsed.left;
|
||||
if (parsed.top !== undefined) parsed.y = parsed.top;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue