Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(value: unknown) {
if (isPrimitive(value)) {
throw new TypeError(
[
'Primitives cannot leak memory.',
'You passed a ' + typeof value + ': <' + prettyFormat(value) + '>',
].join(' '),
);
}
let weak: typeof import('weak-napi');
try {
// eslint-disable-next-line import/no-extraneous-dependencies
weak = require('weak-napi');
} catch (err) {
if (!err || err.code !== 'MODULE_NOT_FOUND') {
throw err;