How to use is-callable - 1 common examples

To help you get started, we’ve selected a few is-callable 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 airbnb / enzyme / packages / enzyme / src / Debug.js View on Github external
function propString(prop, options) {
  if (isString(prop)) {
    return inspect(String(prop), { quoteStyle: 'double' });
  }
  if (isNumber(prop)) {
    return `{${inspect(Number(prop))}}`;
  }
  if (isBoolean(prop)) {
    return `{${inspect(booleanValue(prop))}}`;
  }
  if (isCallable(prop)) {
    return `{${inspect(prop)}}`;
  }
  if (typeof prop === 'object') {
    if (options.verbose) {
      return `{${inspect(prop)}}`;
    }

    return '{{...}}';
  }
  return `{[${typeof prop}]}`;
}

is-callable

Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag.

MIT
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis

Popular is-callable functions