Socket
Socket
Sign inDemoInstall

is-map

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-map

Is this value a JS Map? This module works cross-realm/iframe, and despite ES6 @@toStringTag.


Version published
Weekly downloads
18M
increased by1.9%
Maintainers
1
Weekly downloads
 
Created

What is is-map?

The `is-map` npm package is a utility library designed to provide a simple and efficient way to check if a given value is a Map object. It is particularly useful in scenarios where type-checking is necessary to ensure that operations on map-like structures are performed safely and correctly.

What are is-map's main functionalities?

Type Checking for Map Objects

This feature allows developers to check if a given value is an instance of a Map. It is particularly useful for validating inputs or ensuring that certain operations are only performed on Map objects. The code sample demonstrates how to use `is-map` to distinguish between Map objects and regular JavaScript objects.

const isMap = require('is-map');

console.log(isMap(new Map())); // true
console.log(isMap({})); // false

Other packages similar to is-map

Keywords

FAQs

Package last updated on 08 Mar 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