mocha 10.5.2 → 10.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,7 +7,6 @@
7
7
  <p align="center">
8
8
  <a href="https://github.com/mochajs/mocha/actions?query=workflow%3ATests+branch%3Amain"><img src="https://github.com/mochajs/mocha/workflows/Tests/badge.svg?branch=main" alt="GitHub Actions Build Status"></a>
9
9
  <a href="https://coveralls.io/github/mochajs/mocha"><img src="https://coveralls.io/repos/github/mochajs/mocha/badge.svg" alt="Coverage Status"></a>
10
- <a href="https://app.fossa.io/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha?ref=badge_shield"><img src="https://app.fossa.io/api/projects/git%2Bhttps%3A%2F%2Fgithub.com%2Fmochajs%2Fmocha.svg?type=shield" alt="FOSSA Status"></a>
11
10
  <a href="https://discord.gg/KeDn2uXhER"><img alt="Chat - Discord" src="https://img.shields.io/badge/chat-Discord-5765F2.svg" /></a>
12
11
  <a href="https://github.com/mochajs/mocha#sponsors"><img src="https://opencollective.com/mochajs/tiers/sponsors/badge.svg" alt="OpenCollective Sponsors"></a>
13
12
  <a href="https://github.com/mochajs/mocha#backers"><img src="https://opencollective.com/mochajs/tiers/backers/badge.svg" alt="OpenCollective Backers"></a>
package/lib/runnable.js CHANGED
@@ -20,6 +20,8 @@ var setTimeout = global.setTimeout;
20
20
  var clearTimeout = global.clearTimeout;
21
21
  var toString = Object.prototype.toString;
22
22
 
23
+ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
24
+
23
25
  module.exports = Runnable;
24
26
 
25
27
  /**
@@ -95,8 +97,7 @@ Runnable.prototype.timeout = function (ms) {
95
97
  }
96
98
 
97
99
  // Clamp to range
98
- var INT_MAX = Math.pow(2, 31) - 1;
99
- var range = [0, INT_MAX];
100
+ var range = [0, MAX_TIMEOUT];
100
101
  ms = utils.clamp(ms, range);
101
102
 
102
103
  // see #1652 for reasoning
@@ -233,11 +234,8 @@ Runnable.prototype.clearTimeout = function () {
233
234
  */
234
235
  Runnable.prototype.resetTimeout = function () {
235
236
  var self = this;
236
- var ms = this.timeout();
237
+ var ms = this.timeout() || MAX_TIMEOUT;
237
238
 
238
- if (ms === 0) {
239
- return;
240
- }
241
239
  this.clearTimeout();
242
240
  this.timer = setTimeout(function () {
243
241
  if (self.timeout() === 0) {
package/lib/utils.js CHANGED
@@ -138,7 +138,7 @@ function emptyRepresentation(value, typeHint) {
138
138
  * canonicalType(global) // 'global'
139
139
  * canonicalType(new String('foo') // 'object'
140
140
  * canonicalType(async function() {}) // 'asyncfunction'
141
- * canonicalType(await import(name)) // 'module'
141
+ * canonicalType(Object.create(null)) // 'null-prototype'
142
142
  */
143
143
  var canonicalType = (exports.canonicalType = function canonicalType(value) {
144
144
  if (value === undefined) {
@@ -147,7 +147,10 @@ var canonicalType = (exports.canonicalType = function canonicalType(value) {
147
147
  return 'null';
148
148
  } else if (Buffer.isBuffer(value)) {
149
149
  return 'buffer';
150
+ } else if (Object.getPrototypeOf(value) === null) {
151
+ return 'null-prototype';
150
152
  }
153
+
151
154
  return Object.prototype.toString
152
155
  .call(value)
153
156
  .replace(/^\[.+\s(.+?)]$/, '$1')
@@ -213,7 +216,7 @@ exports.type = function type(value) {
213
216
  exports.stringify = function (value) {
214
217
  var typeHint = canonicalType(value);
215
218
 
216
- if (!~['object', 'array', 'function'].indexOf(typeHint)) {
219
+ if (!~['object', 'array', 'function', 'null-prototype'].indexOf(typeHint)) {
217
220
  if (typeHint === 'buffer') {
218
221
  var json = Buffer.prototype.toJSON.call(value);
219
222
  // Based on the toJSON result
@@ -399,8 +402,12 @@ exports.canonicalize = function canonicalize(value, stack, typeHint) {
399
402
  break;
400
403
  }
401
404
  /* falls through */
405
+ case 'null-prototype':
402
406
  case 'object':
403
407
  canonicalizedObj = canonicalizedObj || {};
408
+ if (typeHint === 'null-prototype' && Symbol.toStringTag in value) {
409
+ canonicalizedObj['[Symbol.toStringTag]'] = value[Symbol.toStringTag];
410
+ }
404
411
  withStack(value, function () {
405
412
  Object.keys(value)
406
413
  .sort()
package/mocha.js CHANGED
@@ -1,4 +1,4 @@
1
- // mocha@10.5.2 in javascript ES2018
1
+ // mocha@10.6.1 in javascript ES2018
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -5820,6 +5820,8 @@
5820
5820
  /*istanbul ignore end*/
5821
5821
  diff: function diff(oldString, newString) {
5822
5822
  /*istanbul ignore start*/
5823
+ var _options$timeout;
5824
+
5823
5825
  var
5824
5826
  /*istanbul ignore end*/
5825
5827
  options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
@@ -5853,84 +5855,123 @@
5853
5855
  oldLen = oldString.length;
5854
5856
  var editLength = 1;
5855
5857
  var maxEditLength = newLen + oldLen;
5858
+
5859
+ if (options.maxEditLength) {
5860
+ maxEditLength = Math.min(maxEditLength, options.maxEditLength);
5861
+ }
5862
+
5863
+ var maxExecutionTime =
5864
+ /*istanbul ignore start*/
5865
+ (_options$timeout =
5866
+ /*istanbul ignore end*/
5867
+ options.timeout) !== null && _options$timeout !== void 0 ? _options$timeout : Infinity;
5868
+ var abortAfterTimestamp = Date.now() + maxExecutionTime;
5856
5869
  var bestPath = [{
5857
- newPos: -1,
5858
- components: []
5870
+ oldPos: -1,
5871
+ lastComponent: undefined
5859
5872
  }]; // Seed editLength = 0, i.e. the content starts with the same values
5860
5873
 
5861
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
5874
+ var newPos = this.extractCommon(bestPath[0], newString, oldString, 0);
5862
5875
 
5863
- if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
5876
+ if (bestPath[0].oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
5864
5877
  // Identity per the equality and tokenizer
5865
5878
  return done([{
5866
5879
  value: this.join(newString),
5867
5880
  count: newString.length
5868
5881
  }]);
5869
- } // Main worker method. checks all permutations of a given edit length for acceptance.
5870
-
5882
+ } // Once we hit the right edge of the edit graph on some diagonal k, we can
5883
+ // definitely reach the end of the edit graph in no more than k edits, so
5884
+ // there's no point in considering any moves to diagonal k+1 any more (from
5885
+ // which we're guaranteed to need at least k+1 more edits).
5886
+ // Similarly, once we've reached the bottom of the edit graph, there's no
5887
+ // point considering moves to lower diagonals.
5888
+ // We record this fact by setting minDiagonalToConsider and
5889
+ // maxDiagonalToConsider to some finite value once we've hit the edge of
5890
+ // the edit graph.
5891
+ // This optimization is not faithful to the original algorithm presented in
5892
+ // Myers's paper, which instead pointlessly extends D-paths off the end of
5893
+ // the edit graph - see page 7 of Myers's paper which notes this point
5894
+ // explicitly and illustrates it with a diagram. This has major performance
5895
+ // implications for some common scenarios. For instance, to compute a diff
5896
+ // where the new text simply appends d characters on the end of the
5897
+ // original text of length n, the true Myers algorithm will take O(n+d^2)
5898
+ // time while this optimization needs only O(n+d) time.
5899
+
5900
+
5901
+ var minDiagonalToConsider = -Infinity,
5902
+ maxDiagonalToConsider = Infinity; // Main worker method. checks all permutations of a given edit length for acceptance.
5871
5903
 
5872
5904
  function execEditLength() {
5873
- for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
5905
+ for (var diagonalPath = Math.max(minDiagonalToConsider, -editLength); diagonalPath <= Math.min(maxDiagonalToConsider, editLength); diagonalPath += 2) {
5874
5906
  var basePath =
5875
5907
  /*istanbul ignore start*/
5876
5908
  void 0
5877
5909
  /*istanbul ignore end*/
5878
5910
  ;
5911
+ var removePath = bestPath[diagonalPath - 1],
5912
+ addPath = bestPath[diagonalPath + 1];
5879
5913
 
5880
- var addPath = bestPath[diagonalPath - 1],
5881
- removePath = bestPath[diagonalPath + 1],
5882
- _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
5883
-
5884
- if (addPath) {
5914
+ if (removePath) {
5885
5915
  // No one else is going to attempt to use this value, clear it
5886
5916
  bestPath[diagonalPath - 1] = undefined;
5887
5917
  }
5888
5918
 
5889
- var canAdd = addPath && addPath.newPos + 1 < newLen,
5890
- canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
5919
+ var canAdd = false;
5920
+
5921
+ if (addPath) {
5922
+ // what newPos will be after we do an insertion:
5923
+ var addPathNewPos = addPath.oldPos - diagonalPath;
5924
+ canAdd = addPath && 0 <= addPathNewPos && addPathNewPos < newLen;
5925
+ }
5926
+
5927
+ var canRemove = removePath && removePath.oldPos + 1 < oldLen;
5891
5928
 
5892
5929
  if (!canAdd && !canRemove) {
5893
5930
  // If this path is a terminal then prune
5894
5931
  bestPath[diagonalPath] = undefined;
5895
5932
  continue;
5896
5933
  } // Select the diagonal that we want to branch from. We select the prior
5897
- // path whose position in the new string is the farthest from the origin
5934
+ // path whose position in the old string is the farthest from the origin
5898
5935
  // and does not pass the bounds of the diff graph
5936
+ // TODO: Remove the `+ 1` here to make behavior match Myers algorithm
5937
+ // and prefer to order removals before insertions.
5899
5938
 
5900
5939
 
5901
- if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
5902
- basePath = clonePath(removePath);
5903
- self.pushComponent(basePath.components, undefined, true);
5940
+ if (!canRemove || canAdd && removePath.oldPos + 1 < addPath.oldPos) {
5941
+ basePath = self.addToPath(addPath, true, undefined, 0);
5904
5942
  } else {
5905
- basePath = addPath; // No need to clone, we've pulled it from the list
5906
-
5907
- basePath.newPos++;
5908
- self.pushComponent(basePath.components, true, undefined);
5943
+ basePath = self.addToPath(removePath, undefined, true, 1);
5909
5944
  }
5910
5945
 
5911
- _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done
5946
+ newPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
5912
5947
 
5913
- if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
5914
- return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
5948
+ if (basePath.oldPos + 1 >= oldLen && newPos + 1 >= newLen) {
5949
+ // If we have hit the end of both strings, then we are done
5950
+ return done(buildValues(self, basePath.lastComponent, newString, oldString, self.useLongestToken));
5915
5951
  } else {
5916
- // Otherwise track this path as a potential candidate and continue.
5917
5952
  bestPath[diagonalPath] = basePath;
5953
+
5954
+ if (basePath.oldPos + 1 >= oldLen) {
5955
+ maxDiagonalToConsider = Math.min(maxDiagonalToConsider, diagonalPath - 1);
5956
+ }
5957
+
5958
+ if (newPos + 1 >= newLen) {
5959
+ minDiagonalToConsider = Math.max(minDiagonalToConsider, diagonalPath + 1);
5960
+ }
5918
5961
  }
5919
5962
  }
5920
5963
 
5921
5964
  editLength++;
5922
5965
  } // Performs the length of edit iteration. Is a bit fugly as this has to support the
5923
5966
  // sync and async mode which is never fun. Loops over execEditLength until a value
5924
- // is produced.
5967
+ // is produced, or until the edit length exceeds options.maxEditLength (if given),
5968
+ // in which case it will return undefined.
5925
5969
 
5926
5970
 
5927
5971
  if (callback) {
5928
5972
  (function exec() {
5929
5973
  setTimeout(function () {
5930
- // This should not happen, but we want to be safe.
5931
-
5932
- /* istanbul ignore next */
5933
- if (editLength > maxEditLength) {
5974
+ if (editLength > maxEditLength || Date.now() > abortAfterTimestamp) {
5934
5975
  return callback();
5935
5976
  }
5936
5977
 
@@ -5940,7 +5981,7 @@
5940
5981
  }, 0);
5941
5982
  })();
5942
5983
  } else {
5943
- while (editLength <= maxEditLength) {
5984
+ while (editLength <= maxEditLength && Date.now() <= abortAfterTimestamp) {
5944
5985
  var ret = execEditLength();
5945
5986
 
5946
5987
  if (ret) {
@@ -5953,23 +5994,29 @@
5953
5994
  /*istanbul ignore start*/
5954
5995
 
5955
5996
  /*istanbul ignore end*/
5956
- pushComponent: function pushComponent(components, added, removed) {
5957
- var last = components[components.length - 1];
5997
+ addToPath: function addToPath(path, added, removed, oldPosInc) {
5998
+ var last = path.lastComponent;
5958
5999
 
5959
6000
  if (last && last.added === added && last.removed === removed) {
5960
- // We need to clone here as the component clone operation is just
5961
- // as shallow array clone
5962
- components[components.length - 1] = {
5963
- count: last.count + 1,
5964
- added: added,
5965
- removed: removed
6001
+ return {
6002
+ oldPos: path.oldPos + oldPosInc,
6003
+ lastComponent: {
6004
+ count: last.count + 1,
6005
+ added: added,
6006
+ removed: removed,
6007
+ previousComponent: last.previousComponent
6008
+ }
5966
6009
  };
5967
6010
  } else {
5968
- components.push({
5969
- count: 1,
5970
- added: added,
5971
- removed: removed
5972
- });
6011
+ return {
6012
+ oldPos: path.oldPos + oldPosInc,
6013
+ lastComponent: {
6014
+ count: 1,
6015
+ added: added,
6016
+ removed: removed,
6017
+ previousComponent: last
6018
+ }
6019
+ };
5973
6020
  }
5974
6021
  },
5975
6022
 
@@ -5979,8 +6026,8 @@
5979
6026
  extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
5980
6027
  var newLen = newString.length,
5981
6028
  oldLen = oldString.length,
5982
- newPos = basePath.newPos,
5983
- oldPos = newPos - diagonalPath,
6029
+ oldPos = basePath.oldPos,
6030
+ newPos = oldPos - diagonalPath,
5984
6031
  commonCount = 0;
5985
6032
 
5986
6033
  while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
@@ -5990,13 +6037,14 @@
5990
6037
  }
5991
6038
 
5992
6039
  if (commonCount) {
5993
- basePath.components.push({
5994
- count: commonCount
5995
- });
6040
+ basePath.lastComponent = {
6041
+ count: commonCount,
6042
+ previousComponent: basePath.lastComponent
6043
+ };
5996
6044
  }
5997
6045
 
5998
- basePath.newPos = newPos;
5999
- return oldPos;
6046
+ basePath.oldPos = oldPos;
6047
+ return newPos;
6000
6048
  },
6001
6049
 
6002
6050
  /*istanbul ignore start*/
@@ -6047,7 +6095,20 @@
6047
6095
  }
6048
6096
  };
6049
6097
 
6050
- function buildValues(diff, components, newString, oldString, useLongestToken) {
6098
+ function buildValues(diff, lastComponent, newString, oldString, useLongestToken) {
6099
+ // First we convert our linked list of components in reverse order to an
6100
+ // array in the right order:
6101
+ var components = [];
6102
+ var nextComponent;
6103
+
6104
+ while (lastComponent) {
6105
+ components.push(lastComponent);
6106
+ nextComponent = lastComponent.previousComponent;
6107
+ delete lastComponent.previousComponent;
6108
+ lastComponent = nextComponent;
6109
+ }
6110
+
6111
+ components.reverse();
6051
6112
  var componentPos = 0,
6052
6113
  componentLen = components.length,
6053
6114
  newPos = 0,
@@ -6090,23 +6151,16 @@
6090
6151
  // This is only available for string mode.
6091
6152
 
6092
6153
 
6093
- var lastComponent = components[componentLen - 1];
6154
+ var finalComponent = components[componentLen - 1];
6094
6155
 
6095
- if (componentLen > 1 && typeof lastComponent.value === 'string' && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
6096
- components[componentLen - 2].value += lastComponent.value;
6156
+ if (componentLen > 1 && typeof finalComponent.value === 'string' && (finalComponent.added || finalComponent.removed) && diff.equals('', finalComponent.value)) {
6157
+ components[componentLen - 2].value += finalComponent.value;
6097
6158
  components.pop();
6098
6159
  }
6099
6160
 
6100
6161
  return components;
6101
6162
  }
6102
6163
 
6103
- function clonePath(path) {
6104
- return {
6105
- newPos: path.newPos,
6106
- components: path.components.slice(0)
6107
- };
6108
- }
6109
-
6110
6164
  }(base));
6111
6165
 
6112
6166
  var character = {};
@@ -6322,6 +6376,11 @@
6322
6376
 
6323
6377
  /*istanbul ignore end*/
6324
6378
  lineDiff.tokenize = function (value) {
6379
+ if (this.options.stripTrailingCr) {
6380
+ // remove one \r before \n to match GNU diff's --strip-trailing-cr behavior
6381
+ value = value.replace(/\r\n/g, '\n');
6382
+ }
6383
+
6325
6384
  var retLines = [],
6326
6385
  linesAndNewlines = value.split(/(\n|\r\n)/); // Ignore the final empty token that occurs if the string ends with a new line
6327
6386
 
@@ -7042,7 +7101,7 @@
7042
7101
  var line = _hunk.lines[j],
7043
7102
  operation = line.length > 0 ? line[0] : ' ',
7044
7103
  content = line.length > 0 ? line.substr(1) : line,
7045
- delimiter = _hunk.linedelimiters[j];
7104
+ delimiter = _hunk.linedelimiters && _hunk.linedelimiters[j] || '\n';
7046
7105
 
7047
7106
  if (operation === ' ') {
7048
7107
  _toPos++;
@@ -7184,6 +7243,11 @@
7184
7243
  diffLines)
7185
7244
  /*istanbul ignore end*/
7186
7245
  (oldStr, newStr, options);
7246
+
7247
+ if (!diff) {
7248
+ return;
7249
+ }
7250
+
7187
7251
  diff.push({
7188
7252
  value: '',
7189
7253
  lines: []
@@ -7360,6 +7424,10 @@
7360
7424
  }
7361
7425
 
7362
7426
  function formatPatch(diff) {
7427
+ if (Array.isArray(diff)) {
7428
+ return diff.map(formatPatch).join('\n');
7429
+ }
7430
+
7363
7431
  var ret = [];
7364
7432
 
7365
7433
  if (diff.oldFileName == diff.newFileName) {
@@ -8038,6 +8106,70 @@
8038
8106
  };
8039
8107
  }
8040
8108
 
8109
+ var reverse = {};
8110
+
8111
+ /*istanbul ignore start*/
8112
+
8113
+ Object.defineProperty(reverse, "__esModule", {
8114
+ value: true
8115
+ });
8116
+ reverse.reversePatch = reversePatch;
8117
+
8118
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
8119
+
8120
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
8121
+
8122
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8123
+
8124
+ /*istanbul ignore end*/
8125
+ function reversePatch(structuredPatch) {
8126
+ if (Array.isArray(structuredPatch)) {
8127
+ return structuredPatch.map(reversePatch).reverse();
8128
+ }
8129
+
8130
+ return (
8131
+ /*istanbul ignore start*/
8132
+ _objectSpread(_objectSpread({},
8133
+ /*istanbul ignore end*/
8134
+ structuredPatch), {}, {
8135
+ oldFileName: structuredPatch.newFileName,
8136
+ oldHeader: structuredPatch.newHeader,
8137
+ newFileName: structuredPatch.oldFileName,
8138
+ newHeader: structuredPatch.oldHeader,
8139
+ hunks: structuredPatch.hunks.map(function (hunk) {
8140
+ return {
8141
+ oldLines: hunk.newLines,
8142
+ oldStart: hunk.newStart,
8143
+ newLines: hunk.oldLines,
8144
+ newStart: hunk.oldStart,
8145
+ linedelimiters: hunk.linedelimiters,
8146
+ lines: hunk.lines.map(function (l) {
8147
+ if (l.startsWith('-')) {
8148
+ return (
8149
+ /*istanbul ignore start*/
8150
+ "+".concat(
8151
+ /*istanbul ignore end*/
8152
+ l.slice(1))
8153
+ );
8154
+ }
8155
+
8156
+ if (l.startsWith('+')) {
8157
+ return (
8158
+ /*istanbul ignore start*/
8159
+ "-".concat(
8160
+ /*istanbul ignore end*/
8161
+ l.slice(1))
8162
+ );
8163
+ }
8164
+
8165
+ return l;
8166
+ })
8167
+ };
8168
+ })
8169
+ })
8170
+ );
8171
+ }
8172
+
8041
8173
  var dmp = {};
8042
8174
 
8043
8175
  /*istanbul ignore start*/
@@ -8211,6 +8343,12 @@
8211
8343
  return _merge.merge;
8212
8344
  }
8213
8345
  });
8346
+ Object.defineProperty(exports, "reversePatch", {
8347
+ enumerable: true,
8348
+ get: function get() {
8349
+ return _reverse.reversePatch;
8350
+ }
8351
+ });
8214
8352
  Object.defineProperty(exports, "structuredPatch", {
8215
8353
  enumerable: true,
8216
8354
  get: function get() {
@@ -8229,6 +8367,12 @@
8229
8367
  return _create.createPatch;
8230
8368
  }
8231
8369
  });
8370
+ Object.defineProperty(exports, "formatPatch", {
8371
+ enumerable: true,
8372
+ get: function get() {
8373
+ return _create.formatPatch;
8374
+ }
8375
+ });
8232
8376
  Object.defineProperty(exports, "convertChangesToDMP", {
8233
8377
  enumerable: true,
8234
8378
  get: function get() {
@@ -8309,6 +8453,12 @@
8309
8453
  /*istanbul ignore end*/
8310
8454
  ;
8311
8455
 
8456
+ var
8457
+ /*istanbul ignore start*/
8458
+ _reverse = reverse
8459
+ /*istanbul ignore end*/
8460
+ ;
8461
+
8312
8462
  var
8313
8463
  /*istanbul ignore start*/
8314
8464
  _create = create
@@ -10951,7 +11101,7 @@
10951
11101
  * canonicalType(global) // 'global'
10952
11102
  * canonicalType(new String('foo') // 'object'
10953
11103
  * canonicalType(async function() {}) // 'asyncfunction'
10954
- * canonicalType(await import(name)) // 'module'
11104
+ * canonicalType(Object.create(null)) // 'null-prototype'
10955
11105
  */
10956
11106
  var canonicalType = (exports.canonicalType = function canonicalType(value) {
10957
11107
  if (value === undefined) {
@@ -10960,7 +11110,10 @@
10960
11110
  return 'null';
10961
11111
  } else if (isBuffer(value)) {
10962
11112
  return 'buffer';
11113
+ } else if (Object.getPrototypeOf(value) === null) {
11114
+ return 'null-prototype';
10963
11115
  }
11116
+
10964
11117
  return Object.prototype.toString
10965
11118
  .call(value)
10966
11119
  .replace(/^\[.+\s(.+?)]$/, '$1')
@@ -11026,7 +11179,7 @@
11026
11179
  exports.stringify = function (value) {
11027
11180
  var typeHint = canonicalType(value);
11028
11181
 
11029
- if (!~['object', 'array', 'function'].indexOf(typeHint)) {
11182
+ if (!~['object', 'array', 'function', 'null-prototype'].indexOf(typeHint)) {
11030
11183
  if (typeHint === 'buffer') {
11031
11184
  var json = Buffer.prototype.toJSON.call(value);
11032
11185
  // Based on the toJSON result
@@ -11212,8 +11365,12 @@
11212
11365
  break;
11213
11366
  }
11214
11367
  /* falls through */
11368
+ case 'null-prototype':
11215
11369
  case 'object':
11216
11370
  canonicalizedObj = canonicalizedObj || {};
11371
+ if (typeHint === 'null-prototype' && Symbol.toStringTag in value) {
11372
+ canonicalizedObj['[Symbol.toStringTag]'] = value[Symbol.toStringTag];
11373
+ }
11217
11374
  withStack(value, function () {
11218
11375
  Object.keys(value)
11219
11376
  .sort()
@@ -12810,6 +12967,8 @@
12810
12967
  var clearTimeout$1 = commonjsGlobal.clearTimeout;
12811
12968
  var toString = Object.prototype.toString;
12812
12969
 
12970
+ var MAX_TIMEOUT = Math.pow(2, 31) - 1;
12971
+
12813
12972
  var runnable = Runnable$3;
12814
12973
 
12815
12974
  /**
@@ -12885,8 +13044,7 @@
12885
13044
  }
12886
13045
 
12887
13046
  // Clamp to range
12888
- var INT_MAX = Math.pow(2, 31) - 1;
12889
- var range = [0, INT_MAX];
13047
+ var range = [0, MAX_TIMEOUT];
12890
13048
  ms = utils$2.clamp(ms, range);
12891
13049
 
12892
13050
  // see #1652 for reasoning
@@ -13023,11 +13181,8 @@
13023
13181
  */
13024
13182
  Runnable$3.prototype.resetTimeout = function () {
13025
13183
  var self = this;
13026
- var ms = this.timeout();
13184
+ var ms = this.timeout() || MAX_TIMEOUT;
13027
13185
 
13028
- if (ms === 0) {
13029
- return;
13030
- }
13031
13186
  this.clearTimeout();
13032
13187
  this.timer = setTimeout$2(function () {
13033
13188
  if (self.timeout() === 0) {
@@ -19019,7 +19174,7 @@
19019
19174
  };
19020
19175
 
19021
19176
  var name = "mocha";
19022
- var version = "10.5.2";
19177
+ var version = "10.6.1";
19023
19178
  var homepage = "https://mochajs.org/";
19024
19179
  var notifyLogo = "https://ibin.co/4QuRuGjXvl36.png";
19025
19180
  var require$$17 = {