@digipair/skill-git 0.42.0 → 0.43.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.cjs.js +15 -12
  2. package/index.esm.js +15 -12
  3. package/package.json +1 -1
package/index.cjs.js CHANGED
@@ -548,12 +548,13 @@ function useColors() {
548
548
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
549
549
  return false;
550
550
  }
551
+ var m;
551
552
  // Is webkit? http://stackoverflow.com/a/16459606/376773
552
553
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
553
554
  return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
554
555
  typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
555
556
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
556
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
557
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
557
558
  typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
558
559
  }
559
560
  /**
@@ -4048,15 +4049,17 @@ var init_parse_diff_summary = __esm({
4048
4049
  ];
4049
4050
  nameStatusParser = [
4050
4051
  new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/, function(result, param) {
4051
- var _param = _sliced_to_array(param, 5), status = _param[0]; _param[1]; var from = _param[2]; _param[3]; var to = _param[4];
4052
+ var _param = _sliced_to_array(param, 5), status = _param[0], similarity = _param[1], from = _param[2]; _param[3]; var to = _param[4];
4052
4053
  result.changed++;
4053
4054
  result.files.push({
4054
4055
  file: to != null ? to : from,
4055
4056
  changes: 0,
4056
- status: orVoid(isDiffNameStatus(status) && status),
4057
4057
  insertions: 0,
4058
4058
  deletions: 0,
4059
- binary: false
4059
+ binary: false,
4060
+ status: orVoid(isDiffNameStatus(status) && status),
4061
+ from: orVoid(!!to && from !== to && from),
4062
+ similarity: asNumber(similarity)
4060
4063
  });
4061
4064
  })
4062
4065
  ];
@@ -4077,9 +4080,9 @@ function createListLogSummaryParser() {
4077
4080
  var splitter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : SPLITTER, fields = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultFieldNames, logFormat = arguments.length > 2 && arguments[2] !== void 0 /* NONE */ ? arguments[2] : "";
4078
4081
  var parseDiffResult = getDiffParser(logFormat);
4079
4082
  return function(stdOut) {
4080
- var all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) {
4081
- var lineDetail = item.trim().split(COMMIT_BOUNDARY);
4082
- var listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields);
4083
+ var all = toLinesWithContent(stdOut.trim(), false, START_BOUNDARY).map(function(item) {
4084
+ var lineDetail = item.split(COMMIT_BOUNDARY);
4085
+ var listLogLine = lineBuilder(lineDetail[0].split(splitter), fields);
4083
4086
  if (lineDetail.length > 1 && !!lineDetail[1].trim()) {
4084
4087
  listLogLine.diff = parseDiffResult(lineDetail[1]);
4085
4088
  }
@@ -4743,20 +4746,20 @@ var init_show = __esm({
4743
4746
  var fromPathRegex, FileStatusSummary;
4744
4747
  var init_FileStatusSummary = __esm({
4745
4748
  "src/lib/responses/FileStatusSummary.ts": function() {
4746
- fromPathRegex = /^(.+) -> (.+)$/;
4749
+ fromPathRegex = /^(.+)\0(.+)$/;
4747
4750
  FileStatusSummary = function FileStatusSummary(path, index, working_dir) {
4748
4751
  _class_call_check(this, FileStatusSummary);
4749
4752
  this.path = path;
4750
4753
  this.index = index;
4751
4754
  this.working_dir = working_dir;
4752
- if ("R" === index + working_dir) {
4755
+ if (index === "R" || working_dir === "R") {
4753
4756
  var detail = fromPathRegex.exec(path) || [
4754
4757
  null,
4755
4758
  path,
4756
4759
  path
4757
4760
  ];
4758
- this.from = detail[1] || "";
4759
- this.path = detail[2] || "";
4761
+ this.from = detail[2] || "";
4762
+ this.path = detail[1] || "";
4760
4763
  }
4761
4764
  };
4762
4765
  }
@@ -4802,7 +4805,7 @@ function splitLine(result, lineStr) {
4802
4805
  handler(result, path);
4803
4806
  }
4804
4807
  if (raw !== "##" && raw !== "!!") {
4805
- result.files.push(new FileStatusSummary(path.replace(/\0.+$/, ""), index, workingDir));
4808
+ result.files.push(new FileStatusSummary(path, index, workingDir));
4806
4809
  }
4807
4810
  }
4808
4811
  }
package/index.esm.js CHANGED
@@ -537,12 +537,13 @@ function useColors() {
537
537
  if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
538
538
  return false;
539
539
  }
540
+ var m;
540
541
  // Is webkit? http://stackoverflow.com/a/16459606/376773
541
542
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
542
543
  return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
543
544
  typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
544
545
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
545
- typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
546
+ typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
546
547
  typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
547
548
  }
548
549
  /**
@@ -4037,15 +4038,17 @@ var init_parse_diff_summary = __esm({
4037
4038
  ];
4038
4039
  nameStatusParser = [
4039
4040
  new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/, function(result, param) {
4040
- var _param = _sliced_to_array(param, 5), status = _param[0]; _param[1]; var from = _param[2]; _param[3]; var to = _param[4];
4041
+ var _param = _sliced_to_array(param, 5), status = _param[0], similarity = _param[1], from = _param[2]; _param[3]; var to = _param[4];
4041
4042
  result.changed++;
4042
4043
  result.files.push({
4043
4044
  file: to != null ? to : from,
4044
4045
  changes: 0,
4045
- status: orVoid(isDiffNameStatus(status) && status),
4046
4046
  insertions: 0,
4047
4047
  deletions: 0,
4048
- binary: false
4048
+ binary: false,
4049
+ status: orVoid(isDiffNameStatus(status) && status),
4050
+ from: orVoid(!!to && from !== to && from),
4051
+ similarity: asNumber(similarity)
4049
4052
  });
4050
4053
  })
4051
4054
  ];
@@ -4066,9 +4069,9 @@ function createListLogSummaryParser() {
4066
4069
  var splitter = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : SPLITTER, fields = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : defaultFieldNames, logFormat = arguments.length > 2 && arguments[2] !== void 0 /* NONE */ ? arguments[2] : "";
4067
4070
  var parseDiffResult = getDiffParser(logFormat);
4068
4071
  return function(stdOut) {
4069
- var all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) {
4070
- var lineDetail = item.trim().split(COMMIT_BOUNDARY);
4071
- var listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields);
4072
+ var all = toLinesWithContent(stdOut.trim(), false, START_BOUNDARY).map(function(item) {
4073
+ var lineDetail = item.split(COMMIT_BOUNDARY);
4074
+ var listLogLine = lineBuilder(lineDetail[0].split(splitter), fields);
4072
4075
  if (lineDetail.length > 1 && !!lineDetail[1].trim()) {
4073
4076
  listLogLine.diff = parseDiffResult(lineDetail[1]);
4074
4077
  }
@@ -4732,20 +4735,20 @@ var init_show = __esm({
4732
4735
  var fromPathRegex, FileStatusSummary;
4733
4736
  var init_FileStatusSummary = __esm({
4734
4737
  "src/lib/responses/FileStatusSummary.ts": function() {
4735
- fromPathRegex = /^(.+) -> (.+)$/;
4738
+ fromPathRegex = /^(.+)\0(.+)$/;
4736
4739
  FileStatusSummary = function FileStatusSummary(path, index, working_dir) {
4737
4740
  _class_call_check(this, FileStatusSummary);
4738
4741
  this.path = path;
4739
4742
  this.index = index;
4740
4743
  this.working_dir = working_dir;
4741
- if ("R" === index + working_dir) {
4744
+ if (index === "R" || working_dir === "R") {
4742
4745
  var detail = fromPathRegex.exec(path) || [
4743
4746
  null,
4744
4747
  path,
4745
4748
  path
4746
4749
  ];
4747
- this.from = detail[1] || "";
4748
- this.path = detail[2] || "";
4750
+ this.from = detail[2] || "";
4751
+ this.path = detail[1] || "";
4749
4752
  }
4750
4753
  };
4751
4754
  }
@@ -4791,7 +4794,7 @@ function splitLine(result, lineStr) {
4791
4794
  handler(result, path);
4792
4795
  }
4793
4796
  if (raw !== "##" && raw !== "!!") {
4794
- result.files.push(new FileStatusSummary(path.replace(/\0.+$/, ""), index, workingDir));
4797
+ result.files.push(new FileStatusSummary(path, index, workingDir));
4795
4798
  }
4796
4799
  }
4797
4800
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-git",
3
- "version": "0.42.0",
3
+ "version": "0.43.2",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"