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

source-academy / plugins / 27974749198

22 Jun 2026 06:25PM UTC coverage: 41.032% (-40.0%) from 81.081%
27974749198

Pull #38

github

web-flow
Merge 5879a1978 into a31e3fb33
Pull Request #38: Add Data Visualisation

98 of 298 branches covered (32.89%)

Branch coverage included in aggregate %.

214 of 488 new or added lines in 20 files covered. (43.85%)

236 of 516 relevant lines covered (45.74%)

1.33 hits per line

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

7.41
/src/web/data-display/src/dataVisualizerUtils.ts
1
import { Config } from "./Config";
2
import type { Data, EmptyList, List, Pair } from "./dataVisualizerTypes";
3
import { is_list, is_pair } from "./list";
4

5
/**
6
 *  Returns data in text form, fitted into the box.
7
 *  If not possible to fit data, return undefined. A number will be assigned and logged in the console.
8
 */
9
export function toText(data: Data, full: boolean = false): string | undefined {
×
NEW
10
  if (full) {
×
NEW
11
    return "" + data;
×
12
  } else {
NEW
13
    const type = typeof data;
×
NEW
14
    if ((type === "function" || type === "object") && data !== null) {
×
NEW
15
      return undefined;
×
NEW
16
    } else if (type === "string") {
×
NEW
17
      const dataString = data + "";
×
NEW
18
      const str = dataString.substring(0, Config.MaxTextLength);
×
NEW
19
      return `${str}${dataString.length > Config.MaxTextLength ? "..." : ""}`;
×
20
    } else {
NEW
21
      return `${data}`;
×
22
    }
23
  }
24
}
25

26
export function isArray(data: Data): data is Array<Data> {
27
  return Array.isArray(data);
7✔
28
}
29

30
export function isFunction(data: Data): data is (...args: unknown[]) => unknown {
31
  return typeof data === "function";
4✔
32
}
33

34
export function isPair(data: Data): data is Pair {
NEW
35
  return is_pair(data);
×
36
}
37

38
export function isList(data: Data): data is List {
NEW
39
  return is_list(data);
×
40
}
41

42
export function isEmptyList(data: Data): data is EmptyList {
NEW
43
  return data === null;
×
44
}
45

46
export { head, tail } from "./list";
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