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

joniflink / comp-se-200-assignment-part2 / 19835145086

01 Dec 2025 07:38PM UTC coverage: 88.356% (+88.4%) from 0.0%
19835145086

push

github

web-flow
Update package.json

36 of 49 branches covered (73.47%)

Branch coverage included in aggregate %.

222 of 243 relevant lines covered (91.36%)

1.98 hits per line

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

79.07
/src/.internal/baseToString.js
1
import isSymbol from '../isSymbol.js'
1✔
2

1✔
3
/** Used as references for various `Number` constants. */
1✔
4
const INFINITY = 1 / 0
1✔
5

1✔
6
/** Used to convert symbols to primitives and strings. */
1✔
7
const symbolToString = Symbol.prototype.toString
1✔
8

1✔
9
/**
1✔
10
 * The base implementation of `toString` which doesn't convert nullish
1✔
11
 * values to empty strings.
1✔
12
 *
1✔
13
 * @private
1✔
14
 * @param {*} value The value to process.
1✔
15
 * @returns {string} Returns the string.
1✔
16
 */
1✔
17
function baseToString(value) {
4✔
18
  // Exit early for strings to avoid a performance hit in some environments.
4✔
19
  if (typeof value === 'string') {
4✔
20
    return value
2✔
21
  }
2✔
22
  if (Array.isArray(value)) {
4!
23
    // Recursively convert values (susceptible to call stack limits).
×
24
    return `${value.map(baseToString)}`
×
25
  }
✔
26
  if (isSymbol(value)) {
4!
27
    return symbolToString ? symbolToString.call(value) : ''
×
28
  }
✔
29
  const result = `${value}`
2✔
30
  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result
4!
31
}
4✔
32

1✔
33
export default baseToString
1✔
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