jest-leak-detector
Advanced tools
Comparing version 23.0.0-alpha.2 to 23.0.0-alpha.4
@@ -7,3 +7,3 @@ /** | ||
* | ||
* | ||
* | ||
*/ | ||
@@ -13,3 +13,3 @@ | ||
Object.defineProperty(exports, "__esModule", { | ||
Object.defineProperty(exports, '__esModule', { | ||
value: true | ||
@@ -21,3 +21,3 @@ }); | ||
function _load_prettyFormat() { | ||
return _prettyFormat = _interopRequireDefault(require('pretty-format')); | ||
return (_prettyFormat = _interopRequireDefault(require('pretty-format'))); | ||
} | ||
@@ -28,3 +28,3 @@ | ||
function _load_v() { | ||
return _v = _interopRequireDefault(require('v8')); | ||
return (_v = _interopRequireDefault(require('v8'))); | ||
} | ||
@@ -35,14 +35,30 @@ | ||
function _load_vm() { | ||
return _vm = _interopRequireDefault(require('vm')); | ||
return (_vm = _interopRequireDefault(require('vm'))); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _interopRequireDefault(obj) { | ||
return obj && obj.__esModule ? obj : {default: obj}; | ||
} | ||
const PRIMITIVE_TYPES = new Set(['undefined', 'boolean', 'number', 'string', 'symbol']); | ||
const PRIMITIVE_TYPES = new Set([ | ||
'undefined', | ||
'boolean', | ||
'number', | ||
'string', | ||
'symbol' | ||
]); | ||
exports.default = class { | ||
constructor(value) { | ||
if (this._isPrimitive(value)) { | ||
throw new TypeError(['Primitives cannot leak memory.', 'You passed a ' + typeof value + ': <' + (0, (_prettyFormat || _load_prettyFormat()).default)(value) + '>'].join(' ')); | ||
throw new TypeError( | ||
[ | ||
'Primitives cannot leak memory.', | ||
'You passed a ' + | ||
typeof value + | ||
': <' + | ||
(0, (_prettyFormat || _load_prettyFormat()).default)(value) + | ||
'>' | ||
].join(' ') | ||
); | ||
} | ||
@@ -60,6 +76,9 @@ | ||
throw new Error('The leaking detection mechanism requires the "weak" package to be installed and work. ' + 'Please install it as a dependency on your main project'); | ||
throw new Error( | ||
'The leaking detection mechanism requires the "weak" package to be installed and work. ' + | ||
'Please install it as a dependency on your main project' | ||
); | ||
} | ||
weak(value, () => this._isReferenceBeingHeld = false); | ||
weak(value, () => (this._isReferenceBeingHeld = false)); | ||
this._isReferenceBeingHeld = true; | ||
@@ -93,2 +112,2 @@ | ||
} | ||
}; | ||
}; |
{ | ||
"name": "jest-leak-detector", | ||
"version": "23.0.0-alpha.2", | ||
"version": "23.0.0-alpha.4", | ||
"repository": { | ||
@@ -11,3 +11,3 @@ "type": "git", | ||
"dependencies": { | ||
"pretty-format": "^23.0.0-alpha.2" | ||
"pretty-format": "^23.0.0-alpha.4" | ||
}, | ||
@@ -14,0 +14,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3332
84