libnpmdiff 2.0.2 → 2.0.3
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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/lib/format-diff.js +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -78,9 +78,9 @@ Fetches the registry tarballs and compare files between a spec `a` and spec `b`.
|
|
|
78
78
|
|
|
79
79
|
- `color <Boolean>`: Should add ANSI colors to string output? Defaults to `false`.
|
|
80
80
|
- `tagVersionPrefix <Sring>`: What prefix should be used to define version numbers. Defaults to `v`
|
|
81
|
-
- `
|
|
81
|
+
- `diffUnified <Number>`: How many lines of code to print before/after each diff. Defaults to `3`.
|
|
82
82
|
- `diffFiles <Array<String>>`: If set only prints patches for the files listed in this array (also accepts globs). Defaults to `undefined`.
|
|
83
|
-
- `
|
|
83
|
+
- `diffIgnoreAllSpace <Boolean>`: Whether or not should ignore changes in whitespace (very useful to avoid indentation changes extra diff lines). Defaults to `false`.
|
|
84
84
|
- `diffNameOnly <Boolean>`: Prints only file names and no patch diffs. Defaults to `false`.
|
|
85
85
|
- `diffNoPrefix <Boolean>`: If true then skips printing any prefixes in filenames. Defaults to `false`.
|
|
86
86
|
- `diffSrcPrefix <String>`: Prefix to be used in the filenames from `a`. Defaults to `a/`.
|
package/lib/format-diff.js
CHANGED
|
@@ -70,8 +70,8 @@ const formatDiff = ({ files, opts = {}, refs, versions }) => {
|
|
|
70
70
|
'',
|
|
71
71
|
'',
|
|
72
72
|
{
|
|
73
|
-
context: opts.
|
|
74
|
-
ignoreWhitespace: opts.
|
|
73
|
+
context: opts.diffUnified === 0 ? 0 : opts.diffUnified || 3,
|
|
74
|
+
ignoreWhitespace: opts.diffIgnoreAllSpace,
|
|
75
75
|
}
|
|
76
76
|
).replace(
|
|
77
77
|
'===================================================================\n',
|