@pierre/diffs 1.0.4 → 1.0.5
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.
|
@@ -5,8 +5,9 @@ function parseLineType(line) {
|
|
|
5
5
|
console.error(`parseLineType: Invalid firstChar: "${firstChar}", full line: "${line}"`);
|
|
6
6
|
return;
|
|
7
7
|
}
|
|
8
|
+
const processedLine = line.substring(1);
|
|
8
9
|
return {
|
|
9
|
-
line:
|
|
10
|
+
line: processedLine === "" ? "\n" : processedLine,
|
|
10
11
|
type: firstChar === " " ? "context" : firstChar === "\\" ? "metadata" : firstChar === "+" ? "addition" : "deletion"
|
|
11
12
|
};
|
|
12
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseLineType.js","names":[],"sources":["../../src/utils/parseLineType.ts"],"sourcesContent":["import type { HunkLineType } from '../types';\n\nexport interface ParsedLine {\n line: string;\n type: Exclude<HunkLineType, 'expanded'>;\n}\n\nexport function parseLineType(line: string): ParsedLine | undefined {\n const firstChar = line[0];\n if (\n firstChar !== '+' &&\n firstChar !== '-' &&\n firstChar !== ' ' &&\n firstChar !== '\\\\'\n ) {\n console.error(\n `parseLineType: Invalid firstChar: \"${firstChar}\", full line: \"${line}\"`\n );\n return undefined;\n }\n return {\n
|
|
1
|
+
{"version":3,"file":"parseLineType.js","names":[],"sources":["../../src/utils/parseLineType.ts"],"sourcesContent":["import type { HunkLineType } from '../types';\n\nexport interface ParsedLine {\n line: string;\n type: Exclude<HunkLineType, 'expanded'>;\n}\n\nexport function parseLineType(line: string): ParsedLine | undefined {\n const firstChar = line[0];\n if (\n firstChar !== '+' &&\n firstChar !== '-' &&\n firstChar !== ' ' &&\n firstChar !== '\\\\'\n ) {\n console.error(\n `parseLineType: Invalid firstChar: \"${firstChar}\", full line: \"${line}\"`\n );\n return undefined;\n }\n const processedLine = line.substring(1);\n return {\n // NOTE(amadeus): If the line is empty, we should make it a\n // newline to force shiki to highlight the row. This should\n // only really ever apply as the last line of a hunk that was most likely\n // processed via a string and not a file since patch files will include a\n // newline here by default\n line: processedLine === '' ? '\\n' : processedLine,\n type:\n firstChar === ' '\n ? 'context'\n : firstChar === '\\\\'\n ? 'metadata'\n : firstChar === '+'\n ? 'addition'\n : 'deletion',\n };\n}\n"],"mappings":";AAOA,SAAgB,cAAc,MAAsC;CAClE,MAAM,YAAY,KAAK;AACvB,KACE,cAAc,OACd,cAAc,OACd,cAAc,OACd,cAAc,MACd;AACA,UAAQ,MACN,sCAAsC,UAAU,iBAAiB,KAAK,GACvE;AACD;;CAEF,MAAM,gBAAgB,KAAK,UAAU,EAAE;AACvC,QAAO;EAML,MAAM,kBAAkB,KAAK,OAAO;EACpC,MACE,cAAc,MACV,YACA,cAAc,OACZ,aACA,cAAc,MACZ,aACA;EACX"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pierre/diffs",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "apache-2.0",
|
|
6
6
|
"scripts": {
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
"@arethetypeswrong/core": "0.18.2",
|
|
49
49
|
"@trivago/prettier-plugin-sort-imports": "6.0.0",
|
|
50
50
|
"@types/hast": "3.0.4",
|
|
51
|
-
"@types/react": "19.2.
|
|
52
|
-
"@types/react-dom": "19.2.
|
|
51
|
+
"@types/react": "19.2.7",
|
|
52
|
+
"@types/react-dom": "19.2.3",
|
|
53
53
|
"autoprefixer": "10.4.22",
|
|
54
54
|
"postcss": "8.5.6",
|
|
55
|
-
"react": "19.2.
|
|
56
|
-
"react-dom": "19.2.
|
|
55
|
+
"react": "19.2.3",
|
|
56
|
+
"react-dom": "19.2.3",
|
|
57
57
|
"tsdown": "0.15.11",
|
|
58
58
|
"typescript": "5.9.2"
|
|
59
59
|
},
|