Socket
Book a DemoInstallSign in
Socket

es-abstract-is-callable

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-abstract-is-callable

A method to determine if an argument is a callable function with a call method

0.1.0
latest
Source
npmnpm
Version published
Weekly downloads
9
125%
Maintainers
1
Weekly downloads
 
Created
Source

IsCallable

A method to determine if an argument is a callable function with a call method. This method follows ECMAScript's specification for the 'IsCallable ' abstract operation.

Currently, this module only supports the ES2017 (ES8) specification.

This module follows the spec in order of operations, but has no way of checking internal methods. It checks against public methods instead. You may be interested in is-callable as an alternative.

Installation Using npm

npm install es-abstract-is-callable

Example Usage

var isCallable = require('es-abstract-is-callable')

var a = {
    yep: function() {},
    nope: "foo"
}

function b() {}

var c = {
    call: function() {}
}

console.log(isCallable(a))      // => false
console.log(isCallable(a.yep))  // => true
console.log(isCallable(a.nope)) // => false
console.log(isCallable(b))      // => true
console.log(isCallable(c))      // => true

Documentation

API

IsCallable ( argument )

The abstract operation IsCallable determines if argument, which must be an ECMAScript language value, is a callable function with a [[Call]] internal method.

A Boolean value is returned.

argument

Type: *

The value to check.

  • is-callable: "Is this JS value callable? Works with Functions and GeneratorFunctions, despite ES6 @@toStringTag."
  • es-abstract: a single library for multiple ECMAScript abstract operations.

Keywords

IsCallable

FAQs

Package last updated on 28 Jul 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.