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

gitdiff-parser

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

gitdiff-parser - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

index.d.ts

12

CHANGELOG.md
ChangeLog
========
0.2.2
-------
+ 【feat】- 删除文件时加入 oldMode 信息;添加文件时加入 newMode 信息
0.2.1
-------
+ 【bugfix】- index 行中的 mode 信息读取不正确。该问题为 0.2.0 引入
0.2.0

@@ -5,0 +17,0 @@ -------

31

index.js

@@ -53,17 +53,3 @@ /**

// read mode change
var nextLine = lines[i + 1];
if (nextLine.indexOf('old') === 0) {
currentInfo.oldMode = nextLine.slice(9, 16);
currentInfo.newMode = lines[i + 2].slice(9, 16);
i += 2;
nextLine = lines[i + 1];
}
// read similarity
if (nextLine.indexOf('similarity') === 0) {
currentInfo.similarity = parseInt(nextLine.split(' ')[2], 10);
i += 1;
}
// read type and index

@@ -80,2 +66,14 @@ var simiLine;

case 'deleted':
case 'new':
var leftStr = simiLine.slice(spaceIndex + 1);
if (leftStr.indexOf('file mode') === 0) {
currentInfo[infoType === 'new' ? 'newMode' : 'oldMode'] = leftStr.slice(10);
}
break;
case 'similarity':
currentInfo.similarity = parseInt(simiLine.split(' ')[2], 10);
break;
case 'index':

@@ -102,2 +100,3 @@ var segs = simiLine.slice(spaceIndex + 1).split(' ');

}
currentInfoType = infoType;
break;

@@ -126,6 +125,2 @@

}
if (!currentInfoType) {
currentInfoType = infoType;
}
}

@@ -132,0 +127,0 @@

{
"name": "gitdiff-parser",
"version": "0.2.1",
"version": "0.2.2",
"description": "",

@@ -14,3 +14,4 @@ "main": "index.js",

"files": [
"index.js"
"index.js",
"index.d.ts"
],

@@ -17,0 +18,0 @@ "repository": {

@@ -56,3 +56,3 @@ # gitdiff-parser

isBinary?: boolean;
type: 'add' | 'delete' | 'modify';
type: 'add' | 'delete' | 'modify' | 'rename';
}

@@ -59,0 +59,0 @@

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