proby 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/run.js +5 -4
  2. package/package.json +1 -1
package/lib/run.js CHANGED
@@ -4,27 +4,28 @@ import red from "@rcompat/cli/color/red";
4
4
  import print from "@rcompat/cli/print";
5
5
  import repository from "@rcompat/test/repository";
6
6
  const endings = [".spec.ts", ".spec.js"];
7
- const primitives = ["bigint", "boolean", "string", "number", "symbol"];
8
7
  function stringify(value) {
9
8
  if (value === null)
10
9
  return "null";
11
10
  if (value === undefined)
12
11
  return "undefined";
13
- if (primitives.includes(typeof value)) {
12
+ if (["string", "number", "boolean", "symbol"].includes(typeof value)) {
14
13
  return value.toString();
15
14
  }
15
+ if (typeof value === "bigint") {
16
+ return value.toString() + "n";
17
+ }
16
18
  if (typeof value === "function") {
17
19
  return `[Function${value.name ? `: ${value.name}` : ""}]`;
18
20
  }
19
21
  if (typeof value === "object") {
20
22
  try {
21
- return JSON.stringify(value);
23
+ return JSON.stringify(value, (_, sub) => stringify(sub));
22
24
  }
23
25
  catch {
24
26
  return "[Object (circular or unserializable)]";
25
27
  }
26
28
  }
27
- // Fallback
28
29
  return String(value);
29
30
  }
30
31
  export default async (root, subrepo) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "proby",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Standard library test runner",
5
5
  "bugs": "https://github.com/rcompat/rcompat/issues",
6
6
  "license": "MIT",