How to use the jest-get-type.isPrimitive function in jest-get-type

To help you get started, we’ve selected a few jest-get-type examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github facebook / jest / packages / jest-leak-detector / src / index.ts View on Github external
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;

jest-get-type

A utility function to get the type of a value

MIT
Latest version published 8 months ago

Package Health Score

91 / 100
Full package analysis

Popular jest-get-type functions

Similar packages