Updating NPM dependencies

This commit is contained in:
Drew Heavner
2020-11-11 13:30:52 +00:00
committed by GitHub
parent 7a6fb66c63
commit bd487ef324
9068 changed files with 1400893 additions and 587661 deletions

View File

@@ -7,7 +7,6 @@
export default class {
private _isReferenceBeingHeld;
constructor(value: unknown);
isLeaking(): boolean;
isLeaking(): Promise<boolean>;
private _runGarbageCollector;
}
//# sourceMappingURL=index.d.ts.map

View File

@@ -1 +0,0 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,MAAM,CAAC,OAAO;IACZ,OAAO,CAAC,qBAAqB,CAAU;gBAE3B,KAAK,EAAE,OAAO;IAiC1B,SAAS,IAAI,OAAO;IAMpB,OAAO,CAAC,oBAAoB;CAY7B"}

View File

@@ -5,10 +5,20 @@ Object.defineProperty(exports, '__esModule', {
});
exports.default = void 0;
function _v() {
const data = _interopRequireDefault(require('v8'));
function _util() {
const data = require('util');
_v = function _v() {
_util = function () {
return data;
};
return data;
}
function _v() {
const data = require('v8');
_v = function () {
return data;
};
@@ -16,19 +26,9 @@ function _v() {
}
function _vm() {
const data = _interopRequireDefault(require('vm'));
const data = require('vm');
_vm = function _vm() {
return data;
};
return data;
}
function _prettyFormat() {
const data = _interopRequireDefault(require('pretty-format'));
_prettyFormat = function _prettyFormat() {
_vm = function () {
return data;
};
@@ -38,7 +38,17 @@ function _prettyFormat() {
function _jestGetType() {
const data = require('jest-get-type');
_jestGetType = function _jestGetType() {
_jestGetType = function () {
return data;
};
return data;
}
function _prettyFormat() {
const data = _interopRequireDefault(require('pretty-format'));
_prettyFormat = function () {
return data;
};
@@ -63,6 +73,8 @@ function _defineProperty(obj, key, value) {
return obj;
}
const tick = (0, _util().promisify)(setImmediate);
class _default {
constructor(value) {
_defineProperty(this, '_isReferenceBeingHeld', void 0);
@@ -84,14 +96,14 @@ class _default {
try {
// eslint-disable-next-line import/no-extraneous-dependencies
weak = require('weak');
weak = require('weak-napi');
} catch (err) {
if (!err || err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
throw new Error(
'The leaking detection mechanism requires the "weak" package to be installed and work. ' +
'The leaking detection mechanism requires the "weak-napi" package to be installed and work. ' +
'Please install it as a dependency on your main project'
);
}
@@ -102,8 +114,12 @@ class _default {
value = null;
}
isLeaking() {
this._runGarbageCollector();
async isLeaking() {
this._runGarbageCollector(); // wait some ticks to allow GC to run properly, see https://github.com/nodejs/node/issues/34636#issuecomment-669366235
for (let i = 0; i < 10; i++) {
await tick();
}
return this._isReferenceBeingHeld;
}
@@ -111,12 +127,11 @@ class _default {
_runGarbageCollector() {
const isGarbageCollectorHidden = !global.gc; // GC is usually hidden, so we have to expose it before running.
_v().default.setFlagsFromString('--expose-gc');
_vm().default.runInNewContext('gc')(); // The GC was not initially exposed, so let's hide it again.
(0, _v().setFlagsFromString)('--expose-gc');
(0, _vm().runInNewContext)('gc')(); // The GC was not initially exposed, so let's hide it again.
if (isGarbageCollectorHidden) {
_v().default.setFlagsFromString('--no-expose-gc');
(0, _v().setFlagsFromString)('--no-expose-gc');
}
}
}