Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libnpmdiff

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libnpmdiff - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

4

CHANGELOG.md
# Changelog
## 1.0.1
- fixed nameOnly option
## 1.0.0

@@ -4,0 +8,0 @@

8

lib/format-diff.js

@@ -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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc