watskeburt 4.1.0 → 4.1.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.
@@ -6,10 +6,7 @@ const OUTPUT_TYPE_TO_FUNCTION = new Map([
6
6
  ]);
7
7
  export function format(pChanges, pOutputType, pExtensions) {
8
8
  const lExtensions = new Set(
9
- pExtensions
10
- .split(",")
11
- .map((pExtension) => pExtension.trim())
12
- .map((pExtension) => `.${pExtension}`),
9
+ pExtensions.split(",").map((pExtension) => `.${pExtension.trim()}`),
13
10
  );
14
11
  return OUTPUT_TYPE_TO_FUNCTION.get(pOutputType)(pChanges, lExtensions);
15
12
  }
@@ -60,7 +60,7 @@ function getGitResult(pArguments, pErrorMap, pSpawnFunction) {
60
60
  } else {
61
61
  pReject(
62
62
  new Error(
63
- pErrorMap.get(pCode ?? 0) ||
63
+ pErrorMap.get(pCode ?? 0) ??
64
64
  `internal git error: ${pCode} (${stringifyOutStream(lStdErrorData)})`,
65
65
  ),
66
66
  );
package/dist/main.js CHANGED
@@ -2,7 +2,7 @@ import { parseDiffLines } from "./parse-diff-lines.js";
2
2
  import { parseStatusLines } from "./parse-status-lines.js";
3
3
  import * as primitives from "./git-primitives.js";
4
4
  export async function list(pOptions) {
5
- const lOldRevision = pOptions?.oldRevision || (await primitives.getSHA());
5
+ const lOldRevision = pOptions?.oldRevision ?? (await primitives.getSHA());
6
6
  const lOptions = pOptions || {};
7
7
  const [lDiffLines, lStatusLines] = await Promise.all([
8
8
  primitives.getDiffLines(lOldRevision, pOptions?.newRevision),
@@ -1,7 +1,7 @@
1
1
  import { EOL } from "node:os";
2
2
  import { mapChangeType } from "./map-change-type.js";
3
3
  const DIFF_NAME_STATUS_LINE_PATTERN =
4
- /^(?<type>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/;
4
+ /^(?<type>[ACDMRTUXB])(?<similarity>\d{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/;
5
5
  export function parseDiffLines(pString) {
6
6
  return pString
7
7
  .split(EOL)
@@ -10,7 +10,7 @@ export function parseDiffLines(pString) {
10
10
  .filter(({ name, type }) => Boolean(name) && Boolean(type));
11
11
  }
12
12
  export function parseDiffLine(pString) {
13
- const lMatchResult = pString.match(DIFF_NAME_STATUS_LINE_PATTERN);
13
+ const lMatchResult = DIFF_NAME_STATUS_LINE_PATTERN.exec(pString);
14
14
  const lReturnValue = {};
15
15
  if (lMatchResult?.groups) {
16
16
  lReturnValue.type = mapChangeType(lMatchResult.groups.type);
@@ -10,7 +10,7 @@ export function parseStatusLines(pString) {
10
10
  .filter(({ name, type }) => Boolean(name) && Boolean(type));
11
11
  }
12
12
  export function parseStatusLine(pString) {
13
- const lMatchResult = pString.match(DIFF_SHORT_STATUS_LINE_PATTERN);
13
+ const lMatchResult = DIFF_SHORT_STATUS_LINE_PATTERN.exec(pString);
14
14
  const lReturnValue = {};
15
15
  if (lMatchResult?.groups) {
16
16
  const lStagedType = mapChangeType(lMatchResult.groups.stagedType);
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "4.1.0";
1
+ export const VERSION = "4.1.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watskeburt",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "List files changed since a git revision",
5
5
  "keywords": [
6
6
  "git",
@@ -48,6 +48,6 @@
48
48
  "node": "^18||>=20"
49
49
  },
50
50
  "scripts": {
51
- "test": "echo for test, build and static analysis scripts: see the github repository"
51
+ "test": "echo see github for test, build and analysis scripts"
52
52
  }
53
53
  }