Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stdlib/assert-is-function

Package Overview
Dependencies
Maintainers
4
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stdlib/assert-is-function

Test if a value is a function.

  • 0.2.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
421K
decreased by-4.93%
Maintainers
4
Weekly downloads
 
Created

What is @stdlib/assert-is-function?

@stdlib/assert-is-function is a utility package that provides functionality to check if a value is a function. This can be useful in various scenarios where type checking is necessary to ensure that a value can be invoked as a function.

What are @stdlib/assert-is-function's main functionalities?

Basic Function Check

This feature allows you to check if a given value is a function. It returns `true` if the value is a function and `false` otherwise.

const isFunction = require('@stdlib/assert-is-function');

console.log(isFunction(function() {})); // true
console.log(isFunction(null)); // false

Arrow Function Check

This feature supports checking if an arrow function is a function. It returns `true` for arrow functions.

const isFunction = require('@stdlib/assert-is-function');

console.log(isFunction(() => {})); // true

Class Method Check

This feature allows you to check if a class method is a function. It returns `true` for class methods.

const isFunction = require('@stdlib/assert-is-function');

class MyClass {
  myMethod() {}
}

console.log(isFunction(MyClass.prototype.myMethod)); // true

Other packages similar to @stdlib/assert-is-function

Keywords

FAQs

Package last updated on 14 Feb 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc