• 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/defaultToAny.js
1
import arrayReduce from './.internal/arrayReduce.js'
2
import defaultTo from './defaultTo.js'
3

4
/**
5
 * This method is like `defaultTo` except that it accepts multiple default values and returns the first one that is not
6
 * `NaN`, `null`, or `undefined`.
7
 *
8
 * @since 5.0.0
9
 * @category Util
10
 * @param {*} value The value to check.
11
 * @param {...*} defaultValues The default values.
12
 * @returns {*} Returns the resolved value.
13
 * @see _.defaultTo
14
 * @example
15
 *
16
 * defaultToAny(1, 10, 20)
17
 * // => 1
18
 *
19
 * defaultToAny(undefined, 10, 20)
20
 * // => 10
21
 *
22
 * defaultToAny(undefined, null, 20)
23
 * // => 20
24
 *
25
 * defaultToAny(undefined, null, NaN)
26
 * // => NaN
27
 */
28
function defaultToAny(value, ...defaultValues) {
NEW
29
  return arrayReduce(defaultValues, defaultTo, value)
×
30
}
31

32
export default defaultToAny
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