Socket
Socket
Sign inDemoInstall

jest-leak-detector

Package Overview
Dependencies
Maintainers
5
Versions
166
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-leak-detector - npm Package Compare versions

Comparing version 29.7.0 to 30.0.0-alpha.1

build/index.mjs

58

build/index.js

@@ -1,9 +0,23 @@

'use strict';
/*!
* /**
* * Copyright (c) Meta Platforms, Inc. and affiliates.
* *
* * This source code is licensed under the MIT license found in the
* * LICENSE file in the root directory of this source tree.
* * /
*/
/******/ (() => { // webpackBootstrap
/******/ "use strict";
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports).
(() => {
var exports = __webpack_exports__;
Object.defineProperty(exports, '__esModule', {
Object.defineProperty(exports, "__esModule", ({
value: true
});
exports.default = void 0;
}));
exports["default"] = void 0;
function _util() {
const data = require('util');
const data = require("util");
_util = function () {

@@ -15,3 +29,3 @@ return data;

function _v() {
const data = require('v8');
const data = require("v8");
_v = function () {

@@ -23,3 +37,3 @@ return data;

function _vm() {
const data = require('vm');
const data = require("vm");
_vm = function () {

@@ -31,3 +45,3 @@ return data;

function _jestGetType() {
const data = require('jest-get-type');
const data = require("jest-get-type");
_jestGetType = function () {

@@ -39,3 +53,3 @@ return data;

function _prettyFormat() {
const data = require('pretty-format');
const data = require("pretty-format");
_prettyFormat = function () {

@@ -60,10 +74,3 @@ return data;

if ((0, _jestGetType().isPrimitive)(value)) {
throw new TypeError(
[
'Primitives cannot leak memory.',
`You passed a ${typeof value}: <${(0, _prettyFormat().format)(
value
)}>`
].join(' ')
);
throw new TypeError(['Primitives cannot leak memory.', `You passed a ${typeof value}: <${(0, _prettyFormat().format)(value)}>`].join(' '));
}

@@ -88,6 +95,14 @@

}
if (this._isReferenceBeingHeld) {
// triggering a heap snapshot is more aggressive than just `global.gc()`,
// but it's also quite slow, so only do it if we still think we're leaking.
// https://github.com/nodejs/node/pull/48510#issuecomment-1719289759
(0, _v().getHeapSnapshot)();
for (let i = 0; i < 10; i++) {
await tick();
}
}
return this._isReferenceBeingHeld;
}
_runGarbageCollector() {
// @ts-expect-error: not a function on `globalThis`
const isGarbageCollectorHidden = globalThis.gc == null;

@@ -105,2 +120,7 @@

}
exports.default = LeakDetector;
exports["default"] = LeakDetector;
})();
module.exports = __webpack_exports__;
/******/ })()
;
{
"name": "jest-leak-detector",
"version": "29.7.0",
"version": "30.0.0-alpha.1",
"repository": {

@@ -15,2 +15,4 @@ "type": "git",

"types": "./build/index.d.ts",
"require": "./build/index.js",
"import": "./build/index.mjs",
"default": "./build/index.js"

@@ -21,4 +23,4 @@ },

"dependencies": {
"jest-get-type": "^29.6.3",
"pretty-format": "^29.7.0"
"jest-get-type": "30.0.0-alpha.1",
"pretty-format": "30.0.0-alpha.1"
},

@@ -29,3 +31,3 @@ "devDependencies": {

"engines": {
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
"node": "^16.10.0 || ^18.12.0 || >=20.0.0"
},

@@ -35,3 +37,3 @@ "publishConfig": {

},
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
"gitHead": "d005cb2505c041583e0c5636d006e08666a54b63"
}
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