@vitest/utils 0.30.1 → 0.31.1

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.
package/dist/diff.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { b as getColors } from './chunk-colors.js';
2
- import concordance from 'concordance';
2
+ import * as concordance from 'concordance';
3
3
 
4
+ const concordanceModule = "default" in concordance ? concordance.default : concordance;
4
5
  function getConcordanceTheme() {
5
6
  const c = getColors();
6
7
  return {
@@ -11,8 +12,8 @@ function getConcordanceTheme() {
11
12
  value: c.blue
12
13
  },
13
14
  diffGutters: {
14
- actual: ` ${c.red("-")} `,
15
- expected: ` ${c.green("+")} `,
15
+ actual: ` ${c.green("-")} `,
16
+ expected: ` ${c.red("+")} `,
16
17
  padding: " "
17
18
  },
18
19
  error: {
@@ -81,7 +82,7 @@ function getConcordanceTheme() {
81
82
  };
82
83
  }
83
84
  function diffDescriptors(actual, expected, options) {
84
- return concordance.diff(expected, actual, options);
85
+ return concordanceModule.diff(expected, actual, options);
85
86
  }
86
87
 
87
88
  function unifiedDiff(actual, expected, options = {}) {
package/dist/index.js CHANGED
@@ -267,7 +267,7 @@ function extractLocation(urlLike) {
267
267
  if (!urlLike.includes(":"))
268
268
  return [urlLike];
269
269
  const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
270
- const parts = regExp.exec(urlLike.replace(/[()]/g, ""));
270
+ const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
271
271
  if (!parts)
272
272
  return [urlLike];
273
273
  return [parts[1], parts[2] || void 0, parts[3] || void 0];
package/package.json CHANGED
@@ -1,14 +1,19 @@
1
1
  {
2
2
  "name": "@vitest/utils",
3
3
  "type": "module",
4
- "version": "0.30.1",
4
+ "version": "0.31.1",
5
5
  "description": "Shared Vitest utility functions",
6
6
  "license": "MIT",
7
+ "funding": "https://opencollective.com/vitest",
8
+ "homepage": "https://github.com/vitest-dev/vitest/tree/main/packages/utils#readme",
7
9
  "repository": {
8
10
  "type": "git",
9
11
  "url": "git+https://github.com/vitest-dev/vitest.git",
10
12
  "directory": "packages/utils"
11
13
  },
14
+ "bugs": {
15
+ "url": "https://github.com/vitest-dev/vitest/issues"
16
+ },
12
17
  "sideEffects": false,
13
18
  "exports": {
14
19
  ".": {