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

syarul / requrse / 15700249788

17 Jun 2025 06:51AM UTC coverage: 98.818% (-0.5%) from 99.32%
15700249788

push

github

syarul
added array mapping for data path

162 of 167 branches covered (97.01%)

Branch coverage included in aggregate %.

1 of 3 new or added lines in 1 file covered. (33.33%)

423 of 425 relevant lines covered (99.53%)

55.2 hits per line

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

82.61
/libs/dataPath.cjs
1
// @ts-check
10✔
2

10✔
3
/**
10✔
4
 * Converts result into data path mapping
10✔
5
 *
10✔
6
 * @param {any} data - The data to map.
10✔
7
 * @returns {any} The final output.
10✔
8
 */
10✔
9
const dataPath = (data, paths = '') => {
10✔
10
  return paths.split('/').reduce((final, path) => {
1✔
11
    if (final instanceof Array) {
3!
NEW
12
      return final.map((item) => item[path] || data[path])
×
NEW
13
    }
×
14
    return (final && final[path]) || data[path]
3!
15
  }, data)
1✔
16
}
1✔
17

10✔
18
module.exports = dataPath
10✔
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

© 2026 Coveralls, Inc