Comparing version 2.3.5 to 2.3.6
28
index.js
@@ -38,3 +38,27 @@ /* ! | ||
const constructorMap = new WeakMap() | ||
function FakeMap() { | ||
// eslint-disable-next-line prefer-template | ||
this.key = 'chai/loupe__' + Math.random() + Date.now() | ||
} | ||
FakeMap.prototype = { | ||
// eslint-disable-next-line object-shorthand | ||
get: function get(key) { | ||
return key[this.key] | ||
}, | ||
// eslint-disable-next-line object-shorthand | ||
has: function has(key) { | ||
return this.key in key | ||
}, | ||
// eslint-disable-next-line object-shorthand | ||
set: function set(key, value) { | ||
if (Object.isExtensible(key)) { | ||
Object.defineProperty(key, this.key, { | ||
// eslint-disable-next-line object-shorthand | ||
value: value, | ||
configurable: true, | ||
}) | ||
} | ||
}, | ||
} | ||
const constructorMap = new (typeof WeakMap === 'function' ? WeakMap : FakeMap)() | ||
const stringTagMap = {} | ||
@@ -182,3 +206,3 @@ const baseTypesMap = { | ||
} | ||
constructorMap.add(constructor, inspector) | ||
constructorMap.set(constructor, inspector) | ||
return true | ||
@@ -185,0 +209,0 @@ } |
29
loupe.js
@@ -687,3 +687,28 @@ (function (global, factory) { | ||
var constructorMap = new WeakMap(); | ||
function FakeMap() { | ||
// eslint-disable-next-line prefer-template | ||
this.key = 'chai/loupe__' + Math.random() + Date.now(); | ||
} | ||
FakeMap.prototype = { | ||
// eslint-disable-next-line object-shorthand | ||
get: function get(key) { | ||
return key[this.key]; | ||
}, | ||
// eslint-disable-next-line object-shorthand | ||
has: function has(key) { | ||
return this.key in key; | ||
}, | ||
// eslint-disable-next-line object-shorthand | ||
set: function set(key, value) { | ||
if (Object.isExtensible(key)) { | ||
Object.defineProperty(key, this.key, { | ||
// eslint-disable-next-line object-shorthand | ||
value: value, | ||
configurable: true | ||
}); | ||
} | ||
} | ||
}; | ||
var constructorMap = new (typeof WeakMap === 'function' ? WeakMap : FakeMap)(); | ||
var stringTagMap = {}; | ||
@@ -838,3 +863,3 @@ var baseTypesMap = { | ||
constructorMap.add(constructor, inspector); | ||
constructorMap.set(constructor, inspector); | ||
return true; | ||
@@ -841,0 +866,0 @@ } |
{ | ||
"name": "loupe", | ||
"version": "2.3.5", | ||
"version": "2.3.6", | ||
"description": "Inspect utility for Node.js and browsers", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/chaijs/loupe", |
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
57741
1383