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

what-the-diff

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

what-the-diff - npm Package Compare versions

Comparing version 0.3.0 to 0.4.0

.tags

7

index.js

@@ -5,9 +5,4 @@ var parser = require('./lib/parser')

parse: function(input) {
try {
return parser.parse(input.toString())
} catch (e) {
console.log(e.location)
throw e
}
return parser.parse(input.toString())
}
}

@@ -1906,14 +1906,10 @@ /*

} else if (file_modes.old_mode && file_modes.new_mode) {
if (patch || binary) {
return {
newPath: header.file_name,
oldPath: header.file_name,
oldMode: file_modes.old_mode,
newMode: file_modes.new_mode,
hunks: patch ? patch.hunks : [],
status: 'modified',
binary: !!binary
}
} else {
throw new Error('patch or binary expected')
return {
newPath: header.file_name,
oldPath: header.file_name,
oldMode: file_modes.old_mode,
newMode: file_modes.new_mode,
hunks: patch ? patch.hunks : [],
status: 'modified',
binary: !!binary
}

@@ -1920,0 +1916,0 @@ } else {

{
"name": "what-the-diff",
"version": "0.3.0",
"version": "0.4.0",
"description": "diff parsing library",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -523,1 +523,23 @@ var diff = require('../')

}
exports.testNoPatch = function(test) {
var str = dedent`
diff --git file.txt file.txt
old mode 100644
new mode 100755
`
const output = diff.parse(str)
assert.deepEqual(output, [
{
oldPath: 'file.txt',
newPath: 'file.txt',
oldMode: '100644',
newMode: '100755',
status: 'modified',
hunks: [],
binary: false
},
])
test.done()
}

Sorry, the diff of this file is not supported yet

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