homarr-labs / homarr

Prefer that for-in loops should include an if statement JS-0051
Anti-pattern
Minor
2 months ago8 months old
Wrap the body of a for-in loop in an if statement with a hasOwnProperty guard
137  const obj = {} as Record<keyof TOptions, unknown>;
138  const options = optionsCallback(optionsFactory);
139
140  for (const key in options) {141    obj[key] = {142      ...configuration?.[key],143      ...options[key],144    };145  }146
147  return obj as {
148    [key in keyof TOptions]: TOptions[key] & FieldConfiguration<TOptions>;