watskeburt 4.0.0 → 4.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,21 +1,19 @@
1
1
  import { EOL } from "node:os";
2
2
  import { changeChar2ChangeType } from "./map-change-type.js";
3
3
  const DIFF_NAME_STATUS_LINE_PATTERN =
4
- /^(?<changeType>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/;
4
+ /^(?<type>[ACDMRTUXB])(?<similarity>[0-9]{3})?[ \t]+(?<name>[^ \t]+)[ \t]*(?<newName>[^ \t]+)?$/;
5
5
  export function parseDiffLines(pString) {
6
6
  return pString
7
7
  .split(EOL)
8
8
  .filter(Boolean)
9
9
  .map(parseDiffLine)
10
- .filter(
11
- ({ name, type: changeType }) => Boolean(name) && Boolean(changeType),
12
- );
10
+ .filter(({ name, type }) => Boolean(name) && Boolean(type));
13
11
  }
14
12
  export function parseDiffLine(pString) {
15
13
  const lMatchResult = pString.match(DIFF_NAME_STATUS_LINE_PATTERN);
16
14
  const lReturnValue = {};
17
15
  if (lMatchResult?.groups) {
18
- lReturnValue.type = changeChar2ChangeType(lMatchResult.groups.changeType);
16
+ lReturnValue.type = changeChar2ChangeType(lMatchResult.groups.type);
19
17
  if (lMatchResult.groups.newName) {
20
18
  lReturnValue.name = lMatchResult.groups.newName;
21
19
  lReturnValue.oldName = lMatchResult.groups.name;
@@ -1,30 +1,24 @@
1
1
  import { EOL } from "node:os";
2
2
  import { changeChar2ChangeType } from "./map-change-type.js";
3
3
  const DIFF_SHORT_STATUS_LINE_PATTERN =
4
- /^(?<stagedChangeType>[ ACDMRTUXB?!])(?<unStagedChangeType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/;
4
+ /^(?<stagedType>[ ACDMRTUXB?!])(?<unStagedType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/;
5
5
  export function parseStatusLines(pString) {
6
6
  return pString
7
7
  .split(EOL)
8
8
  .filter(Boolean)
9
9
  .map(parseStatusLine)
10
- .filter(
11
- ({ name, type: changeType }) => Boolean(name) && Boolean(changeType),
12
- );
10
+ .filter(({ name, type }) => Boolean(name) && Boolean(type));
13
11
  }
14
12
  export function parseStatusLine(pString) {
15
13
  const lMatchResult = pString.match(DIFF_SHORT_STATUS_LINE_PATTERN);
16
14
  const lReturnValue = {};
17
15
  if (lMatchResult?.groups) {
18
- const lStagedChangeType = changeChar2ChangeType(
19
- lMatchResult.groups.stagedChangeType,
20
- );
21
- const lUnStagedChangeType = changeChar2ChangeType(
22
- lMatchResult.groups.unStagedChangeType,
16
+ const lStagedType = changeChar2ChangeType(lMatchResult.groups.stagedType);
17
+ const lUnStagedType = changeChar2ChangeType(
18
+ lMatchResult.groups.unStagedType,
23
19
  );
24
20
  lReturnValue.type =
25
- lStagedChangeType === "unmodified"
26
- ? lUnStagedChangeType
27
- : lStagedChangeType;
21
+ lStagedType === "unmodified" ? lUnStagedType : lStagedType;
28
22
  if (lMatchResult.groups.newName) {
29
23
  lReturnValue.name = lMatchResult.groups.newName;
30
24
  lReturnValue.oldName = lMatchResult.groups.name;
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const VERSION = "4.0.0";
1
+ export const VERSION = "4.0.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "watskeburt",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "List files changed since a git revision",
5
5
  "keywords": [
6
6
  "git",