• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

react-ui-org / react-ui / 14754571926

30 Apr 2025 12:28PM UTC coverage: 90.36% (-0.3%) from 90.674%
14754571926

Pull #629

github

web-flow
Merge 16c03b2ce into f3d65f42a
Pull Request #629: Fix `FileInputField` not resetting properly (#627)

805 of 894 branches covered (90.04%)

Branch coverage included in aggregate %.

7 of 13 new or added lines in 1 file covered. (53.85%)

751 of 828 relevant lines covered (90.7%)

73.92 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.3
/src/utils/mergeDeep.js
1
const isObject = (obj) => obj && typeof obj === 'object' && !Array.isArray(obj);
170✔
2

3
/**
4
 * Performs a deep merge of objects and returns new object.
5
 *
6
 * @param {...object} objects
7
 * @returns {object}
8
 */
9
export const mergeDeep = (...objects) => objects.reduce((prev, obj) => {
82✔
10
  if (obj == null) {
76!
11
    return prev;
×
12
  }
13

14
  const newObject = { ...prev };
76✔
15

16
  Object.keys(obj).forEach((key) => {
76✔
17
    const previousVal = prev[key];
148✔
18
    const currentVal = obj[key];
148✔
19

20
    if (isObject(previousVal) && isObject(currentVal)) {
148✔
21
      newObject[key] = mergeDeep(previousVal, currentVal);
20✔
22
    } else {
23
      newObject[key] = currentVal;
128✔
24
    }
25
  });
26

27
  return newObject;
76✔
28
}, {});
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc