watskeburt 5.0.1 → 5.0.2
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/format/regex.js
CHANGED
|
@@ -17,7 +17,7 @@ export default function formatAsRegex(
|
|
|
17
17
|
pChangeTypes.has(pChange.type) &&
|
|
18
18
|
(pExtensions.has(".*") || pExtensions.has(extname(pChange.name))),
|
|
19
19
|
)
|
|
20
|
-
.map(({ name }) => name.
|
|
20
|
+
.map(({ name }) => name.replaceAll("\\", "\\\\").replaceAll(".", "[.]"))
|
|
21
21
|
.join("|");
|
|
22
22
|
return `^(${lChanges})$`;
|
|
23
23
|
}
|
package/dist/parse-diff-lines.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapChangeType } from "./map-change-type.js";
|
|
2
2
|
const DIFF_NAME_STATUS_LINE_PATTERN =
|
|
3
|
-
/^(?<type>[ACDMRTUXB])(?<similarity>\d{3})?[ \t]+(?<name>[^ \t]+)[ \t]
|
|
3
|
+
/^(?<type>[ACDMRTUXB])(?<similarity>\d{3})?[ \t]+(?<name>[^ \t]+)(?:[ \t]+(?<newName>[^ \t]+))?$/;
|
|
4
4
|
export function parseDiffLines(pString) {
|
|
5
5
|
return pString
|
|
6
6
|
.split(/\r?\n/)
|
|
@@ -13,6 +13,12 @@ export function parseDiffLine(pString) {
|
|
|
13
13
|
const lReturnValue = {};
|
|
14
14
|
if (lMatchResult?.groups) {
|
|
15
15
|
lReturnValue.type = mapChangeType(lMatchResult.groups.type);
|
|
16
|
+
if (lMatchResult.groups.similarity) {
|
|
17
|
+
lReturnValue.similarity = Number.parseInt(
|
|
18
|
+
lMatchResult.groups.similarity,
|
|
19
|
+
10,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
16
22
|
if (lMatchResult.groups.newName) {
|
|
17
23
|
lReturnValue.name = lMatchResult.groups.newName;
|
|
18
24
|
lReturnValue.oldName = lMatchResult.groups.name;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { mapChangeType } from "./map-change-type.js";
|
|
2
2
|
const DIFF_SHORT_STATUS_LINE_PATTERN =
|
|
3
|
-
/^(?<stagedType>[ ACDMRTUXB?!])(?<unStagedType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(( -> )(?<newName>[^ \t]+))?$/;
|
|
3
|
+
/^(?<stagedType>[ ACDMRTUXB?!])(?<unStagedType>[ ACDMRTUXB?!])[ \t]+(?<name>[^ \t]+)(?:(?: -> )(?<newName>[^ \t]+))?$/;
|
|
4
4
|
export function parseStatusLines(pString) {
|
|
5
5
|
return pString
|
|
6
6
|
.split(/\r?\n/)
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "5.0.
|
|
1
|
+
export const VERSION = "5.0.2";
|
package/package.json
CHANGED