Socket
Socket
Sign inDemoInstall

is-map

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    is-map

Easily check if a givin object is an ES6 Map


Version published
Maintainers
1
Install size
3.01 kB
Created

Package description

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

Changelog

Source

v1.0.0 - 2015-02-18

Commits

  • init 73b9f38

Readme

Source

is-map Build Status

Node module to easily check if an object is an ES6 Map

Installation

$ npm install is-map --save

Usage

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

isMap(new Map());
//=> true

isMap({});
//=> false

License

MIT © Arthur Verschaeve

Keywords

FAQs

Last updated on 18 Feb 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc