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

git-diff

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-diff - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

12

package.json
{
"name": "git-diff",
"version": "2.0.1",
"version": "2.0.2",
"description": "Returns the git diff of two strings",

@@ -53,6 +53,6 @@ "author": "Daniel Lewis BSc (Hons)",

"chalk": "^2.1.0",
"diff": "^3.3.1",
"loglevel": "^1.5.0",
"diff": "^3.4.0",
"loglevel": "^1.5.1",
"shelljs": "^0.7.8",
"shelljs.exec": "^1.1.6"
"shelljs.exec": "^1.1.7"
},

@@ -63,7 +63,7 @@ "devDependencies": {

"coveralls": "2.11.16",
"data-driven": "^1.3.0",
"data-driven": "^1.4.0",
"eslint": "^4.8.0",
"husky": "^0.14.3",
"istanbul": "^0.4.5",
"mocha": "^4.0.0",
"mocha": "^4.0.1",
"npm-run-all": "^4.1.1",

@@ -70,0 +70,0 @@ "readfile-go": "^1.0.5",

@@ -46,3 +46,5 @@ # git-diff

var diff = gitDiff(oldStr, newStr)
expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
```

@@ -102,3 +104,5 @@

var diff = gitDiff(oldStr, newStr, {flags: '--diff-algorithm=minimal --ignore-all-space'})
expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny \n')
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny \n')
```

@@ -131,3 +135,5 @@

var diff = gitDiff(oldStr, newStr, {forceFake: true})
expect(diff).to.equal('-fred\n+paul\n is\n funny\n')
var assert = require('assert')
assert.equal(diff, '-fred\n+paul\n is\n funny\n')
```

@@ -151,8 +157,8 @@

var newStr = 'paul\nis\nfunny\n'
var diff
var diff1 = gitDiff(oldStr, newStr, {save: true, wordDiff: true})
var diff2 = gitDiff(oldStr, newStr)
diff = gitDiff(oldStr, newStr, {save: true, wordDiff: true})
expect(diff).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
diff = gitDiff(oldStr, newStr)
expect(diff).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
var assert = require('assert')
assert.equal(diff1, '@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
assert.equal(diff2, '@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
```

@@ -175,3 +181,4 @@

gitDiff(oldStr, newStr).then(function(diff) {
expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
})

@@ -178,0 +185,0 @@ ```

@@ -29,4 +29,7 @@ 'use strict'

var diff = gitDiff(oldStr, newStr)
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
imp.expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
imp.expect(imp.color.add).to.have.not.been.called

@@ -42,2 +45,4 @@ })

// no assert here
imp.expect(diff).to.equal(imp.data.lineDiffReal)

@@ -52,4 +57,7 @@ imp.expect(imp.color.add).to.have.not.been.called

var diff = gitDiff(oldStr, newStr, {flags: '--diff-algorithm=minimal --ignore-all-space'})
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny \n')
imp.expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny \n')
imp.expect(imp.color.add).to.have.not.been.called

@@ -63,4 +71,7 @@ })

var diff = gitDiff(oldStr, newStr, {forceFake: true})
var assert = require('assert')
assert.equal(diff, '-fred\n+paul\n is\n funny\n')
imp.expect(diff).to.equal('-fred\n+paul\n is\n funny\n')
imp.expect(imp.color.add).to.have.not.been.called

@@ -73,9 +84,11 @@ })

var newStr = 'paul\nis\nfunny\n'
var diff
var diff1 = gitDiff(oldStr, newStr, {save: true, wordDiff: true})
var diff2 = gitDiff(oldStr, newStr)
diff = gitDiff(oldStr, newStr, {save: true, wordDiff: true})
imp.expect(diff).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
diff = gitDiff(oldStr, newStr)
imp.expect(diff).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
var assert = require('assert')
assert.equal(diff1, '@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
assert.equal(diff2, '@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
imp.expect(diff1).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
imp.expect(diff2).to.equal('@@ -1,3 +1,3 @@\n[-fred-]{+paul+}\nis\nfunny\n')
imp.expect(imp.color.add).to.have.not.been.called

@@ -89,4 +102,6 @@ })

gitDiff(oldStr, newStr).then(function(diff) {
var assert = require('assert')
assert.equal(diff, '@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
imp.expect(diff).to.equal('@@ -1,3 +1,3 @@\n-fred\n+paul\n is\n funny\n')
imp.expect(imp.color.add).to.have.not.been.called

@@ -93,0 +108,0 @@ 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