libnpmdiff
Advanced tools
Comparing version 1.0.0 to 1.0.1
# Changelog | ||
## 1.0.1 | ||
- fixed nameOnly option | ||
## 1.0.0 | ||
@@ -4,0 +8,0 @@ |
@@ -11,5 +11,2 @@ const EOL = '\n' | ||
const diffOpts = opts.diffOpts || {} | ||
if (diffOpts.nameOnly) | ||
return [...files].reduce((i, res) => `${i}${res}${EOL}`, '') | ||
const srcPrefix = diffOpts.noPrefix ? '' : diffOpts.srcPrefix || 'a/' | ||
@@ -41,2 +38,7 @@ const dstPrefix = diffOpts.noPrefix ? '' : diffOpts.dstPrefix || 'b/' | ||
if (diffOpts.nameOnly) { | ||
res += `${filename}${EOL}` | ||
continue | ||
} | ||
let patch = '' | ||
@@ -43,0 +45,0 @@ let headerLength = 0 |
@@ -10,3 +10,3 @@ const tar = require('tar') | ||
// filterFiles, item, prefix and opts are read-only options | ||
const untar = ({ files, refs }, { filterFiles, nameOnly, item, prefix }) => { | ||
const untar = ({ files, refs }, { filterFiles, item, prefix }) => { | ||
tar.list({ | ||
@@ -27,13 +27,11 @@ filter: (path, entry) => { | ||
let content | ||
if (!nameOnly) { | ||
try { | ||
entry.setEncoding('utf8') | ||
content = entry.concat() | ||
} catch (e) { | ||
/* istanbul ignore next */ | ||
throw Object.assign( | ||
new Error('failed to read files'), | ||
{ code: 'EDIFFUNTAR' } | ||
) | ||
} | ||
try { | ||
entry.setEncoding('utf8') | ||
content = entry.concat() | ||
} catch (e) { | ||
/* istanbul ignore next */ | ||
throw Object.assign( | ||
new Error('failed to read files'), | ||
{ code: 'EDIFFUNTAR' } | ||
) | ||
} | ||
@@ -58,3 +56,3 @@ | ||
const arr = [].concat(tarballs) | ||
const { files: _files, nameOnly } = opts.diffOpts || {} | ||
const { files: _files } = opts.diffOpts || {} | ||
@@ -71,3 +69,2 @@ const filterFiles = _files || [] | ||
filterFiles, | ||
nameOnly, | ||
}) | ||
@@ -74,0 +71,0 @@ } |
{ | ||
"name": "libnpmdiff", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "The registry diff", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/npm/libnpmdiff", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12151
213