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

Agglu / softwaretesting / 19500927678

19 Nov 2025 12:14PM UTC coverage: 0.235%. First build
19500927678

push

github

Aleksanteri Heinonen
import functions to test manually so no more tricky node_modules implementations

0 of 224 branches covered (0.0%)

Branch coverage included in aggregate %.

1 of 201 new or added lines in 43 files covered. (0.5%)

1 of 201 relevant lines covered (0.5%)

0.01 hits per line

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

0.0
/src/castArray.js
1

2
/**
3
 * Casts `value` as an array if it's not one.
4
 *
5
 * @since 4.4.0
6
 * @category Lang
7
 * @param {*} value The value to inspect.
8
 * @returns {Array} Returns the cast array.
9
 * @example
10
 *
11
 * castArray(1)
12
 * // => [1]
13
 *
14
 * castArray({ 'a': 1 })
15
 * // => [{ 'a': 1 }]
16
 *
17
 * castArray('abc')
18
 * // => ['abc']
19
 *
20
 * castArray(null)
21
 * // => [null]
22
 *
23
 * castArray(undefined)
24
 * // => [undefined]
25
 *
26
 * castArray()
27
 * // => []
28
 *
29
 * const array = [1, 2, 3]
30
 * console.log(castArray(array) === array)
31
 * // => true
32
 */
33
function castArray(...args) {
NEW
34
  const value = args[0]
×
NEW
35
  return Array.isArray(value) ? value : [value]
×
36
}
37

38
export default castArray
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